fix recovery

This commit is contained in:
lwl0608 2024-03-21 20:22:10 +08:00
parent ad95c1be67
commit f5cc4e4891
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package httpengine
import ( import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"service/library/logger"
"service/library/middleware" "service/library/middleware"
) )
@ -10,7 +11,7 @@ func NewRouter() *gin.Engine {
router := gin.New() router := gin.New()
router.Use(middleware.LoggerMiddleware(gin.LoggerConfig{})) router.Use(middleware.LoggerMiddleware(gin.LoggerConfig{}))
router.Use(middleware.RecoverMiddleware()) router.Use(gin.RecoveryWithWriter(logger.Global.Out))
return router return router
} }