Skip to content

Commit 3c0f9f4

Browse files
committed
Add debugging option for the request / response cycle.
1 parent bf9ec2c commit 3c0f9f4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

proxy.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@ func proxyTheRequest(c *fiber.Ctx) error {
3838

3939
proxy.WithClient(cfg.Client.FastProxyClient)
4040

41+
cfg.Logger.Debug("Proxying the request", map[string]interface{}{"path": c.Path(), "body": string(c.Request().Body())})
4142
err := proxy.DoRedirects(c, cfg.Server.HostGraphQL+c.Path(), 3)
4243
if err != nil {
4344
cfg.Logger.Error("Can't proxy the request", map[string]interface{}{"error": err.Error()})
4445
cfg.Monitoring.Increment(libpack_monitoring.MetricsFailed, nil)
4546
return err
4647
}
48+
cfg.Logger.Debug("Received proxied response", map[string]interface{}{"path": c.Path(), "response_body": string(c.Response().Body()), "response_code": c.Response().StatusCode()})
4749

4850
c.Response().Header.Del(fiber.HeaderServer)
4951
return nil

0 commit comments

Comments
 (0)