log fix
This commit is contained in:
parent
ad7a42a0f5
commit
edd86f2bb8
|
@ -90,7 +90,9 @@ func LoggerMiddleware(conf gin.LoggerConfig) gin.HandlerFunc {
|
|||
if ok {
|
||||
bodyStr = string(body.([]byte))
|
||||
}
|
||||
if _, ok := NoLogRoutesMap[param.Path]; !ok {
|
||||
logger.Info("%s params: %s", formatter(param), bodyStr)
|
||||
}
|
||||
//logger.Info("%s response: %s", formatter(param), blw.body.String())
|
||||
|
||||
//logger.WithCtx(c.Request.Context()).Info("%s params: %s", formatter(param), bodyStr)
|
||||
|
@ -100,3 +102,7 @@ func LoggerMiddleware(conf gin.LoggerConfig) gin.HandlerFunc {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
var NoLogRoutesMap = map[string]bool{
|
||||
"/healthcheck": true,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue