diff --git a/basculehttp/log.go b/basculehttp/log.go index 038e904..f00d9ee 100644 --- a/basculehttp/log.go +++ b/basculehttp/log.go @@ -85,10 +85,10 @@ func SetLogger(logger *zap.Logger) alice.Constructor { source = host } - logger = logger.With( + l := logger.With( zap.Reflect("request.Headers", sanitizeHeaders(r.Header)), //lgtm [go/clear-text-logging] zap.String("request.URL", r.URL.EscapedPath()), - zap.String("request.method", r.Method), + zap.String("request.Method", r.Method), zap.String("request.address", source), zap.String("request.path", r.URL.Path), zap.String("request.query", r.URL.RawQuery), @@ -96,12 +96,12 @@ func SetLogger(logger *zap.Logger) alice.Constructor { ) traceID, spanID, ok := candlelight.ExtractTraceInfo(r.Context()) if ok { - logger = logger.With( + l = l.With( zap.String(candlelight.TraceIdLogKeyName, traceID), zap.String(candlelight.SpanIDLogKeyName, spanID), ) } - r = r.WithContext(sallust.With(r.Context(), logger)) + r = r.WithContext(sallust.With(r.Context(), l)) delegate.ServeHTTP(w, r) }) }