日志打印问题
This commit is contained in:
parent
0627ea4b56
commit
3f106b60ad
@ -90,6 +90,7 @@ func GinLogger() gin.HandlerFunc {
|
|||||||
query := c.Request.URL.RawQuery
|
query := c.Request.URL.RawQuery
|
||||||
spanID := NewUUID()
|
spanID := NewUUID()
|
||||||
c.Set("X-Span-ID", spanID)
|
c.Set("X-Span-ID", spanID)
|
||||||
|
c.Next()
|
||||||
cost := time.Since(start)
|
cost := time.Since(start)
|
||||||
Lg.Info(path,
|
Lg.Info(path,
|
||||||
zap.Int("status", c.Writer.Status()),
|
zap.Int("status", c.Writer.Status()),
|
||||||
@ -102,7 +103,6 @@ func GinLogger() gin.HandlerFunc {
|
|||||||
zap.String("errors", c.Errors.ByType(gin.ErrorTypePrivate).String()),
|
zap.String("errors", c.Errors.ByType(gin.ErrorTypePrivate).String()),
|
||||||
zap.Duration("cost", cost),
|
zap.Duration("cost", cost),
|
||||||
)
|
)
|
||||||
c.Next()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user