diff options
Diffstat (limited to 'pkg/ext')
-rw-r--r-- | pkg/ext/log.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/ext/log.go b/pkg/ext/log.go index 2439f19..8e68134 100644 --- a/pkg/ext/log.go +++ b/pkg/ext/log.go @@ -45,12 +45,14 @@ func Log(next http.HandlerFunc) http.HandlerFunc { s := wrap(w) next(s, r) encoding := s.Header().Get("Content-Encoding") + userAgent := r.Header.Get("User-Agent") slog.Info( "HTTP request", "method", r.Method, "code", s.StatusCode(), "path", r.URL, "encoding", encoding, + "user-agent", userAgent, "elapsed", time.Since(t), "body-size", s.size, ) |