Add Zap logging framework with structured logging for Echo and Grafana
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user