This commit is contained in:
白茶清欢 2024-09-26 17:40:09 +08:00
parent 22bf77019a
commit 8ceb818a24

View File

@ -100,8 +100,8 @@ func LogRequest(cfg *AccessConfig) gin.HandlerFunc {
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
"request_query": request.WrapperHandle.ParseQuery(ctx), // 获取请求query
"request_body": request.WrapperHandle.ParseBody(ctx), // 请求body
})
cfg.Logger.Info("接口请求日志记录", logger.ZapLogDataList(logData)...)
ctx.Next()