perf(日志): 降噪优化,将常规成功日志降级为 Debug 级别
- GIN Logger 中间件跳过 /health 和 /setup/status 的请求日志 - UsageCleanup 空闲轮询(no_task)日志降级为 slog.Debug - Scheduler 常规 rebuild ok 日志降级为 slog.Debug - DashboardAggregation 常规聚合完成日志降级为 slog.Debug - TokenRefresh 无刷新活动时周期日志降级为 slog.Debug 生产环境(Info 级别)下自动静默,debug 模式下仍可见。 错误、警告类日志保持原有级别不变。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"log"
|
||||
"log/slog"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
@@ -224,11 +225,11 @@ func (s *DashboardAggregationService) runScheduledAggregation() {
|
||||
if updateErr != nil {
|
||||
log.Printf("[DashboardAggregation] 更新水位失败: %v", updateErr)
|
||||
}
|
||||
log.Printf("[DashboardAggregation] 聚合完成 (start=%s end=%s duration=%s watermark_updated=%t)",
|
||||
start.Format(time.RFC3339),
|
||||
now.Format(time.RFC3339),
|
||||
time.Since(jobStart).String(),
|
||||
updateErr == nil,
|
||||
slog.Debug("[DashboardAggregation] 聚合完成",
|
||||
"start", start.Format(time.RFC3339),
|
||||
"end", now.Format(time.RFC3339),
|
||||
"duration", time.Since(jobStart).String(),
|
||||
"watermark_updated", updateErr == nil,
|
||||
)
|
||||
|
||||
s.maybeCleanupRetention(ctx, now)
|
||||
|
||||
Reference in New Issue
Block a user