7 Commits

Author SHA1 Message Date
hoteas d3e71decf4 feat(log): 前后端共用 request_id 与四时间点时钟校准
- X-Request-Id 请求头带合法 UUID 则沿用为 request_id(严格格式白名单防注入),否则自生成 12 位 hex
- 响应头新增 X-Server-Received-Ms / X-Server-Sent-Ms 供前端时钟校准
- CORS Allow-Headers 增加 X-Request-Id,Expose-Headers 显式列出(credentials 下不认 *)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 07:46:38 +08:00
hoteas c8382200a0 docs: Seq LogBind 示例去掉业务项目细节,保持框架通用口径
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 01:52:35 +08:00
hoteas a0719dc72d docs: LogBind 示例更新为入口统一绑定口径
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 01:40:34 +08:00
hoteas 332c2414bc feat(log): 访问日志携带 ua,挂 Seq 后控制台放宽到 Info+
- WebConnectLog 访问日志新增 ua 字段(User-Agent 按 rune 截断 200 字符),便于按设备归因
- SetSeqWriter 挂 Seq 后业务控制台由 Warn+ 放宽为 Info+,Debug/SQL 仍只进 Seq 与文件
- 新增 Logger.SetConsoleMinLevel,访问日志控制台单独保持 Warn+

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 01:35:45 +08:00
hoteas 25faa93724 feat(log): 多源 clientIP 降级与去重 ip_chain
按 EO→XFF非回环→X-Real→RemoteAddr 选取 ip;访问日志附带去重 ip_chain;登录限流改用 clientIP。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-23 06:04:43 +08:00
hoteas 831a7f017a feat(log): Seq 会话追踪、控制台降噪与推送质量增强
请求日志自动带 sid/request_id,支持 LogBind;挂 Seq 后控制台仅 Warn+,Seq 仍全量;并修毫秒时间戳、@m、失败重试与停机 flush。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-23 05:26:44 +08:00
hoteas 6b689f3a1b chore(logging): 更新日志重定向与捕获功能
- 在 .gitignore 中添加调试日志文件的忽略规则,避免不必要的调试信息被提交
- 修改 application.go 中的 stdout 重定向逻辑,使用 log.CaptureStream 以支持更灵活的日志捕获
- 更新 README 文档,增加对日志重定向功能的说明
2026-07-13 07:45:51 +08:00