diff --git a/middleware/logging.go b/middleware/logging.go index fe00d3a82..4a5e4c5a2 100644 --- a/middleware/logging.go +++ b/middleware/logging.go @@ -56,7 +56,7 @@ func NewLogMiddleware(log log.Logger, logRequestHeaders bool, logRequestAtInfoLe // logWithRequest information from the request and context as fields. func (l Log) logWithRequest(r *http.Request) log.Logger { localLog := l.Log - traceID, ok := tracing.ExtractTraceID(r.Context()) + traceID, ok := tracing.ExtractSampledTraceID(r.Context()) if ok { localLog = log.With(localLog, "trace_id", traceID) }