From fcba57c4e307e9605f552646d6db721a65a6e3f1 Mon Sep 17 00:00:00 2001 From: tiglog Date: Tue, 17 Oct 2023 21:05:30 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=8A=8A=20reqId=20=E6=94=BE=E5=9C=A8?= =?UTF-8?q?=E5=89=8D=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gweb/ginlog/access_log.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gweb/ginlog/access_log.go b/gweb/ginlog/access_log.go index eef08da..40c03e1 100644 --- a/gweb/ginlog/access_log.go +++ b/gweb/ginlog/access_log.go @@ -45,7 +45,7 @@ func GinLogger(logfile string) gin.HandlerFunc { } if requestID := c.Writer.Header().Get("X-Request-Id"); requestID != "" { // logger.With(logger.String("reqId", requestID)) - fields = append(fields, logger.String("reqId", requestID)) + fields = append([]logger.Field{logger.String("reqId", requestID)}, fields...) } log.Info("GIN request", fields...)