Skip to content

[ops] 日志文件无轮转 — openless.log 无限增长 #303

@appergb

Description

@appergb

背景

lib.rs::init_file_loggerOpenOptions::append(true) 打开 openless.log,没有大小限制 / 滚动 / truncate 策略。

风险

  • 长期运行(开自启 + 不关)日志会无限增长
  • 用户机器磁盘可能慢慢耗尽(特别在 ASR 大量 JSON 输出场景下)
  • 日志文件过大时打开 / 导出(一键导出错误日志)变慢

建议

  • 启动时检查 log 文件大小 > 10MB 就 truncate / rotate(保留 openless.log.1
  • 或用 tracing-appender 的 rolling file(按大小或日期滚)
  • 一键导出错误日志只发当前会话(不带历史 archive)

来源

docs/audit-2026-05-06.md §1.4 低风险 #9

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions