atmost working example
This commit is contained in:
@ -44,7 +44,7 @@ func middlewareLogger(log *slog.Logger) middlewareFunc {
|
||||
path := r.URL.Path
|
||||
query := r.URL.Query().Encode()
|
||||
|
||||
log.InfoContext(
|
||||
log.DebugContext(
|
||||
r.Context(), "request processing",
|
||||
slog.String("request_id", requestID),
|
||||
slog.String("method", method),
|
||||
@ -54,10 +54,9 @@ func middlewareLogger(log *slog.Logger) middlewareFunc {
|
||||
|
||||
next.ServeHTTP(w, r)
|
||||
|
||||
elapsed := time.Since(start)
|
||||
log.InfoContext(
|
||||
r.Context(), "request finished",
|
||||
slog.Duration("elapsed", elapsed.Truncate(time.Millisecond)),
|
||||
slog.Int64("elapsed", time.Since(start).Milliseconds()),
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user