|
@@ -16,10 +16,10 @@ func GinLogger() gin.HandlerFunc {
|
|
|
UTC: true,
|
|
|
TimeFormat: time.RFC3339,
|
|
|
Context: func(c *gin.Context) []zapcore.Field {
|
|
|
- var body []byte
|
|
|
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 {
|
|
|
return make([]zapcore.Field, 0)
|
|
|
}
|