Skip to content

Commit

Permalink
chore: registrated zap middlewares
Browse files Browse the repository at this point in the history
  • Loading branch information
baimamboukar committed Dec 29, 2023
1 parent a12ac02 commit 4bcf9e9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/middlewares/middlewares.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
package middlewares

import (
"time"

ginzap "github.com/gin-contrib/zap"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)

func RegisterMiddlewares(router *gin.Engine) {
logger, _ := zap.NewProduction()
//router.Use(AuthMiddleware())
router.Use(LoggerMiddleware())
router.Use(PrometheusMiddleware())
router.Use(ginzap.Ginzap(logger, time.RFC3339, true))
router.Use(ginzap.RecoveryWithZap(logger, true))
}

0 comments on commit 4bcf9e9

Please sign in to comment.