diff --git a/middleware/access_log.go b/middleware/access_log.go index 6d89e43..d5cb149 100644 --- a/middleware/access_log.go +++ b/middleware/access_log.go @@ -108,10 +108,10 @@ func Access(cfg *AccessConfig) gin.HandlerFunc { finishRequestTime := wrapper.OwnTime(ctx.GetTime(define.FinishRequestTimeField)) logDataList = append( logDataList, - zap.Any(define.FinishRequestTimeField, startRequestTime.FormatUnixMilli()), - zap.Int64("pkg_gin_request_cost", finishRequestTime.UnixMilli()-startRequestTime.UnixMilli()), - zap.Any("pkg_gin_request_header", getLogRequestHeader(ctx, cfg)), - zap.Any("pkg_gin_response_header", getLogResponseHeader(ctx, cfg)), + zap.Any(define.FinishRequestTimeField, finishRequestTime.FormatUnixMilli()), // 请求完成时间 + zap.Int64("pkg_gin_request_cost", finishRequestTime.UnixMilli()-startRequestTime.UnixMilli()), // 接口耗时 + zap.Any("pkg_gin_request_header", getLogRequestHeader(ctx, cfg)), // 请求header + zap.Any("pkg_gin_response_header", getLogResponseHeader(ctx, cfg)), // 响应header ) // 扩展数据