From 3c0f9f49fdc924be4fb7d5ee6c1d3012acf7a15c Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Fri, 13 Oct 2023 14:23:05 +0100 Subject: [PATCH] Add debugging option for the request / response cycle. --- proxy.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proxy.go b/proxy.go index 6a08f66..25f5949 100644 --- a/proxy.go +++ b/proxy.go @@ -38,12 +38,14 @@ func proxyTheRequest(c *fiber.Ctx) error { proxy.WithClient(cfg.Client.FastProxyClient) + cfg.Logger.Debug("Proxying the request", map[string]interface{}{"path": c.Path(), "body": string(c.Request().Body())}) err := proxy.DoRedirects(c, cfg.Server.HostGraphQL+c.Path(), 3) if err != nil { cfg.Logger.Error("Can't proxy the request", map[string]interface{}{"error": err.Error()}) cfg.Monitoring.Increment(libpack_monitoring.MetricsFailed, nil) return err } + cfg.Logger.Debug("Received proxied response", map[string]interface{}{"path": c.Path(), "response_body": string(c.Response().Body()), "response_code": c.Response().StatusCode()}) c.Response().Header.Del(fiber.HeaderServer) return nil