Skip to content

Commit

Permalink
fix: use context logger for logging request logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Oct 24, 2024
1 parent 9349640 commit 7d6f7bf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func initLogger(level string, pretty bool) {
func NewLoggingMiddleware() negroni.HandlerFunc {
return func(writer http.ResponseWriter, request *http.Request, next http.HandlerFunc) {
metrics := httpsnoop.CaptureMetrics(next, writer, request)
log.Info().
log.Ctx(request.Context()).Info().
Str("path", request.URL.Path).
Str("referer", request.Referer()).
Dur("duration", metrics.Duration).
Expand Down
1 change: 0 additions & 1 deletion middleware.go

This file was deleted.

0 comments on commit 7d6f7bf

Please sign in to comment.