1
0

feat: 运行时日志系统,Pino + pino-pretty + pino-roll,console/file 双输出,敏感信息 redaction

This commit is contained in:
2026-05-21 12:21:59 +08:00
parent 0d709c7681
commit 007d74934d
26 changed files with 1713 additions and 114 deletions

View File

@@ -169,6 +169,22 @@ targets: # 拨测目标列表(必填)
| `maxConcurrentChecks` | 最大并发拨测数 | 否 | `20` |
| `retention` | 历史数据保留时长,支持 `ms`/`s`/`m`/`h`/`d` 单位 | 否 | `7d` |
### logging — 日志配置
| 字段 | 说明 | 必填 | 默认值 |
| ------------------------- | ---------------------------------------------- | ---- | ------------------------- |
| `level` | 全局日志等级console 和 file 未指定时继承此值 | 否 | `info` |
| `console.level` | 控制台日志等级 | 否 | 继承 `level` |
| `file.level` | 文件日志等级 | 否 | 继承 `level` |
| `file.path` | 日志文件路径,相对路径基于配置文件目录解析 | 否 | `<dataDir>/logs/dial.log` |
| `file.rotation.size` | 按大小滚动,支持 `KB`/`MB`/`GB` 单位 | 否 | `50MB` |
| `file.rotation.frequency` | 按时间滚动:`hourly``daily``weekly` | 否 | `daily` |
| `file.rotation.maxFiles` | 保留的归档文件数量(不含活跃日志) | 否 | `14` |
日志等级支持:`trace``debug``info``warn``error``fatal`
控制台始终输出pretty 格式),文件始终输出 JSONL 格式并支持滚动。`rotation.size``rotation.frequency` 任一条件触发即滚动。
### defaults — 全局默认值
| 字段 | 说明 | 必填 | 默认值 |