diff options
Diffstat (limited to 'internal/server/logging.go')
-rw-r--r-- | internal/server/logging.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/internal/server/logging.go b/internal/server/logging.go index 5d607bb..7df35d7 100644 --- a/internal/server/logging.go +++ b/internal/server/logging.go @@ -24,18 +24,16 @@ func NewLoggingResponseWriter(w http.ResponseWriter) *LoggingResponseWriter { func wrapHandlerWithLogging(wrappedHandler http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - host := r.Host lw := NewLoggingResponseWriter(w) wrappedHandler.ServeHTTP(lw, r) if r.URL.Path == "/health" { return } - statusCode := lw.statusCode log.Info( "http request", "method", r.Method, - "status", statusCode, - "host", host, + "status", lw.statusCode, + "host", r.Host, "path", r.URL.Path, "location", lw.Header().Get("Location"), ) |