feat: add configurable loglevel

This commit is contained in:
2026-04-22 22:29:58 +02:00
parent d6df67b643
commit f796ea229f
7 changed files with 38 additions and 17 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ import (
"github.com/gin-gonic/gin"
)
func slogMiddleware(logger *slog.Logger) gin.HandlerFunc {
func slogGinMiddleware(logger *slog.Logger) gin.HandlerFunc {
return func(c *gin.Context) {
start := time.Now()
path := c.Request.URL.Path
@@ -15,7 +15,7 @@ func slogMiddleware(logger *slog.Logger) gin.HandlerFunc {
c.Next()
logger.Info("request",
logger.Debug("request",
slog.String("method", c.Request.Method),
slog.String("path", path),
slog.String("query", query),