feat: 后台服务模式 + 日志滚动 + 修复 llm_usage 表兼容性

- 新增 logger.rs(tracing-appender,日滚日志,.data/logs/)
- service 子命令:等同 listen --llm 但日志同时写入文件
- systemd/ias.service 单元文件
- 迁移 0007:ALTER TABLE llm_usage ADD COLUMN IF NOT EXISTS
  修复与 iPet 旧表的结构冲突
- ias usage 命令可正常查询 Token 统计
- 日志滚动保留 7 天,自动删除旧文件
This commit is contained in:
2026-06-01 17:45:17 +08:00
parent b9de3665d9
commit 00002e4740
13 changed files with 341 additions and 45 deletions
+1
View File
@@ -37,3 +37,4 @@ async-trait = "0.1"
# 流式处理
futures-util = "0.3"
sqlx = { version = "0.8.6", features = ["runtime-tokio-native-tls", "postgres", "uuid", "chrono", "derive", "migrate"] }
tracing-appender = "0.2.5"