diff --git a/middleware/access_log.go b/middleware/access_log.go index 89d7a48..977f192 100644 --- a/middleware/access_log.go +++ b/middleware/access_log.go @@ -98,10 +98,10 @@ func LogRequest(cfg *AccessConfig) gin.HandlerFunc { startRequestTime := request.WrapperHandle.GetCtxIntData(ctx, handleConfig.StartRequestTimeField, 0) // 记录请求日志 logData := logger.NewLogData(ctx, consts.LogTypeRequest, "", map[string]any{ - handleConfig.StartRequestTimeField: startRequestTime, // 开始请求时间 - "request_header": getLogRequestHeader(ctx, cfg), // 请求header - "request_query": request.WrapperHandle.GetQuery(ctx), // 获取请求query - "request_body": request.WrapperHandle.GetRequestBody(ctx), // 请求body + handleConfig.StartRequestTimeField: startRequestTime, // 开始请求时间 + "request_header": getLogRequestHeader(ctx, cfg), // 请求header + "request_query": request.WrapperHandle.ParseQuery(ctx), // 获取请求query + "request_body": request.WrapperHandle.ParseBody(ctx), // 请求body }) cfg.Logger.Info("接口请求日志记录", logger.ZapLogDataList(logData)...) ctx.Next()