This commit is contained in:
Mrx
2026-03-17 17:18:54 +08:00
parent 6f0a8e0519
commit 12ed1c81e3
16 changed files with 763 additions and 123 deletions

View File

@@ -19,15 +19,15 @@ type ComprehensiveLoggerMiddleware struct {
// ComprehensiveLoggerConfig 全面日志配置
type ComprehensiveLoggerConfig struct {
EnableRequestLogging bool // 是否记录请求日志
EnableResponseLogging bool // 是否记录响应日志
EnableRequestBodyLogging bool // 是否记录请求体
EnableErrorLogging bool // 是否记录错误日志
EnableBusinessLogging bool // 是否记录业务日志
EnablePerformanceLogging bool // 是否记录性能日志
MaxBodySize int64 // 最大记录体大小
ExcludePaths []string // 排除的路径
IncludePaths []string // 包含的路径
EnableRequestLogging bool // 是否记录请求日志
EnableResponseLogging bool // 是否记录响应日志
EnableRequestBodyLogging bool // 是否记录请求体
EnableErrorLogging bool // 是否记录错误日志
EnableBusinessLogging bool // 是否记录业务日志
EnablePerformanceLogging bool // 是否记录性能日志
MaxBodySize int64 // 最大记录体大小
ExcludePaths []string // 排除的路径
IncludePaths []string // 包含的路径
}
// NewComprehensiveLoggerMiddleware 创建全面日志中间件
@@ -439,4 +439,4 @@ func (bl *BusinessLogger) getUserIDFromContext(ctx context.Context) string {
}
}
return ""
}
}