From 9fe32a1a7a8482b0cbed58c29bdbe716d81c11ae Mon Sep 17 00:00:00 2001 From: serr Date: Sun, 8 Jun 2025 01:03:46 +0300 Subject: [PATCH] update logging middleware --- mvc/controllers/middlewares.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mvc/controllers/middlewares.go b/mvc/controllers/middlewares.go index d57c130..8516d9f 100644 --- a/mvc/controllers/middlewares.go +++ b/mvc/controllers/middlewares.go @@ -35,6 +35,12 @@ func loggingMiddleware(next http.Handler) http.Handler { next.ServeHTTP(w, r) - log.Printf("%s %s %v", r.Method, r.URL.Path, time.Since(start)) + fullURL := r.URL.String() + + log.Printf("%s %s | client: %s | duration: %v", + r.Method, + fullURL, + r.RemoteAddr, + time.Since(start)) }) }