go-logging(停止维护了)替换成zap, zap的配置完善优化,gva的日志更换zap后的处理
This commit is contained in:
@@ -30,7 +30,7 @@ func GinRecovery(stack bool) gin.HandlerFunc {
|
||||
|
||||
httpRequest, _ := httputil.DumpRequest(c.Request, false)
|
||||
if brokenPipe {
|
||||
global.GVA_ZAP.Error(c.Request.URL.Path,
|
||||
global.GVA_LOG.Error(c.Request.URL.Path,
|
||||
zap.Any("error", err),
|
||||
zap.String("request", string(httpRequest)),
|
||||
)
|
||||
@@ -41,13 +41,13 @@ func GinRecovery(stack bool) gin.HandlerFunc {
|
||||
}
|
||||
|
||||
if stack {
|
||||
global.GVA_ZAP.Error("[Recovery from panic]",
|
||||
global.GVA_LOG.Error("[Recovery from panic]",
|
||||
zap.Any("error", err),
|
||||
zap.String("request", string(httpRequest)),
|
||||
zap.String("stack", string(debug.Stack())),
|
||||
)
|
||||
} else {
|
||||
global.GVA_ZAP.Error("[Recovery from panic]",
|
||||
global.GVA_LOG.Error("[Recovery from panic]",
|
||||
zap.Any("error", err),
|
||||
zap.String("request", string(httpRequest)),
|
||||
)
|
||||
|
Reference in New Issue
Block a user