This commit is contained in:
2024-05-09 17:57:32 -05:00
parent a69d2c7a40
commit 5043720f95
10 changed files with 121 additions and 45 deletions

View File

@@ -1,7 +1,7 @@
package middleware
import (
"log"
"log/slog"
"net/http"
"time"
)
@@ -27,6 +27,13 @@ func Logging(next http.Handler) http.Handler {
next.ServeHTTP(wrapped, r)
log.Println(wrapped.statusCode, r.Method, r.URL.Path, time.Since(start))
slog.Info(
"Health Check",
slog.Int("Method", wrapped.statusCode),
r.Method,
r.URL.Path,
slog.String("time", time.Since(start).String()),
)
// log.Println("INFO", wrapped.statusCode, r.Method, r.URL.Path, time.Since(start))
})
}