Content-type added into the logs

This commit is contained in:
Paramtamtam 2022-01-27 19:28:11 +05:00
parent bed576f26c
commit 0efbccbb18
No known key found for this signature in database
GPG Key ID: 366371698FAD0A2B

View File

@ -27,6 +27,7 @@ func LogRequest(h fasthttp.RequestHandler, log *zap.Logger) fasthttp.RequestHand
zap.String("url", string(ctx.RequestURI())),
zap.String("referer", string(ctx.Referer())),
zap.Int("status_code", ctx.Response.StatusCode()),
zap.String("content_type", string(ctx.Response.Header.ContentType())),
zap.Bool("connection_close", ctx.Response.ConnectionClose()),
zap.Duration("duration", time.Since(startedAt)),
)