|
@@ -16,10 +16,10 @@ func GinLogger() gin.HandlerFunc {
|
|
UTC: true,
|
|
UTC: true,
|
|
TimeFormat: time.RFC3339,
|
|
TimeFormat: time.RFC3339,
|
|
Context: func(c *gin.Context) []zapcore.Field {
|
|
Context: func(c *gin.Context) []zapcore.Field {
|
|
- var body []byte
|
|
|
|
var buf bytes.Buffer
|
|
var buf bytes.Buffer
|
|
|
|
|
|
- body, err := io.ReadAll(c.Request.Body)
|
|
|
|
|
|
+ tee := io.TeeReader(c.Request.Body, &buf)
|
|
|
|
+ body, err := io.ReadAll(tee)
|
|
if err != nil {
|
|
if err != nil {
|
|
return make([]zapcore.Field, 0)
|
|
return make([]zapcore.Field, 0)
|
|
}
|
|
}
|