Files
Genarrative/server-rs/crates/shared-logging/README.md
kdletters cbc27bad4a
Some checks failed
CI / verify (push) Has been cancelled
init with react+axum+spacetimedb
2026-04-26 18:06:23 +08:00

33 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# shared-logging 共享日志 crate 占位说明
日期:`2026-04-21`
## 1. crate 职责
`shared-logging` 是 Rust 工作区统一日志基础设施 crate后续负责
1. 统一 `tracing subscriber` 初始化入口
2. 统一日志过滤器解析逻辑
3. 统一当前阶段日志输出风格
4.`api-server`、后续 `spacetime-module`、测试支撑与独立入口提供可复用日志初始化能力
## 2. 当前阶段说明
当前阶段已完成最小落地:
1. 提供 `resolve_env_filter(...)`
2. 提供 `init_tracing(...)`
3.`api-server` 的日志初始化逻辑迁出为共享 crate
后续与本 crate 直接相关的任务包括:
1. 根据环境扩展日志输出格式
2. 补充测试入口、worker 入口与其它主工程 crate 的统一接入
3. 视需要补充 JSON 输出、链路追踪或远端采集适配
## 3. 边界约束
1. `shared-logging` 只承接日志初始化与基础设施,不承接 HTTP 业务语义。
2. `TraceLayer`、request id、响应头、错误 envelope 等 HTTP 逻辑继续留在 `api-server`
3. 不允许把业务埋点、审计事件或供应商日志适配塞进本 crate。