feat(lyra)!: 添加结构化日志与请求追踪

- 配置 slog JSON 输出和日志级别
- 添加请求 ID、访问日志及上下文日志工具
- 拆分启动初始化并统一启动失败处理

BREAKING CHANGE: 配置文件必须提供 log.level,缺失或非法将导致启动失败
This commit is contained in:
2026-10-20 15:16:35 +08:00
parent 759bc3fc35
commit cd0e13325f
11 changed files with 197 additions and 33 deletions
+3
View File
@@ -2,6 +2,9 @@
name = "lyra"
env = "debug" #gin支持 release | test | debug 3种mode,如果需要自定义,需要映射到这3种mode中去,gin的默认模式是debug模式
[log]
level = "info" #日志级别,支持 debug | info | warn | error |
[http]
host = "0.0.0.0"
port = 7777