Add Zap logging framework with structured logging for Echo and Grafana

This commit is contained in:
2026-05-20 22:29:45 +02:00
parent 82252ce1ff
commit 37909139de
7 changed files with 64 additions and 37 deletions
+2 -1
View File
@@ -11,6 +11,7 @@ import (
"github.com/labstack/echo/v5"
"github.com/labstack/echo/v5/middleware"
echoSwagger "github.com/swaggo/echo-swagger/v2"
"music-server/internal/logging"
)
// @Title MusicServer API
@@ -34,7 +35,7 @@ func (s *Server) RegisterRoutes() http.Handler {
w.Header().Set("Content-Type", "application/json")
http.ServeFile(w, r, "cmd/docs/swagger.json")
})))
e.Use(middleware.RequestLogger())
e.Use(logging.RequestLogger())
e.Use(middleware.Recover())
e.Use(middleware.CORSWithConfig(middleware.CORSConfig{