feat(logging): add Seq transport, global meta fields, and improve error handling

- Add Seq centralized logging transport with async ESM import
- Add appVersion and computerName to logger defaultMeta (all app logs)
- Add appVersion to audit log entries for version-level traceability
- Improve unhandledRejection to capture full stack traces for Error instances
- Add Seq config schema and template configuration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-04-04 16:33:03 +08:00
parent fce8dbc37f
commit 1e0bb1de24
10 changed files with 336 additions and 31 deletions

View File

@@ -63,6 +63,16 @@ logging:
auditRetention: 30
appRetention: 14
# Seq 日志聚合服务配置(可选,用于集中管理日志)
seq:
enabled: false # 设置为 true 启用 Seq 日志发送
serverUrl: 'http://localhost:5341' # Seq 服务器地址
apiKey: '' # 可选API key 用于认证
batchPostingLimit: 50 # 每批次最大日志条目数
period: 2000 # 发送间隔 (毫秒)
queueLimit: 10000 # 本地队列最大容量
maxRetries: 3 # 失败重试次数
# RustFS 对象存储配置(用于持久化报告)
rustfs:
enabled: false # 设置为 true 启用 RustFS 上传