Add method to request log

This commit is contained in:
Torjus Håkestad 2023-10-22 23:12:12 +02:00
parent 717cf333f7
commit e72b2d0f95

View File

@ -15,6 +15,7 @@ func (s *UserServer) MiddlewareLogging(next http.Handler) http.Handler {
defer func(ww middleware.WrapResponseWriter) { defer func(ww middleware.WrapResponseWriter) {
s.Logger.Info("Served request.", s.Logger.Info("Served request.",
"status", ww.Status(), "status", ww.Status(),
"method", r.Method,
"path", r.URL.Path, "path", r.URL.Path,
"duration", time.Since(t1), "duration", time.Since(t1),
"written", ww.BytesWritten()) "written", ww.BytesWritten())