diff --git a/middleware/log.go b/middleware/log.go index 62dd3e73..952a99b2 100644 --- a/middleware/log.go +++ b/middleware/log.go @@ -7,12 +7,11 @@ import ( "github.com/gin-gonic/gin" "github.com/google/uuid" - "github.com/thoas/picfit/config" "github.com/thoas/picfit/constants" loggerpkg "github.com/thoas/picfit/logger" ) -func NewLogger(cfg *config.Config, logger *slog.Logger) gin.HandlerFunc { +func NewLogger(logger *slog.Logger) gin.HandlerFunc { return func(c *gin.Context) { var ( ctx = c.Request.Context() @@ -27,7 +26,6 @@ func NewLogger(cfg *config.Config, logger *slog.Logger) gin.HandlerFunc { c.Next() - end := time.Now() attributes := []slog.Attr{ slog.Int("status", c.Writer.Status()), slog.String("method", c.Request.Method), @@ -36,7 +34,6 @@ func NewLogger(cfg *config.Config, logger *slog.Logger) gin.HandlerFunc { slog.String("ip", c.ClientIP()), slog.Duration("duration", time.Since(start)), slog.String("user-agent", c.Request.UserAgent()), - slog.Time("time", end.UTC()), } if len(c.Errors) > 0 { diff --git a/server/http.go b/server/http.go index ecaf40fb..21da73d5 100644 --- a/server/http.go +++ b/server/http.go @@ -76,7 +76,7 @@ func (s *HTTPServer) Init() error { router.Use(middleware.Recover) } - router.Use(middleware.NewLogger(s.config, s.processor.Logger)) + router.Use(middleware.NewLogger(s.processor.Logger)) router.Use(middleware.Metrics) if s.config.Sentry != nil {