From 5d90a9258212432bf650ad80dbf8b79c48514ec7 Mon Sep 17 00:00:00 2001 From: Zyy Date: Tue, 11 Aug 2026 15:06:40 +0800 Subject: [PATCH] fix(logging): rename OAuth recovery log file Co-authored-by: Codex --- backend/crates/gateway-host/src/logging.rs | 2 +- backend/crates/gateway-host/tests/logging.rs | 2 +- deploy/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/crates/gateway-host/src/logging.rs b/backend/crates/gateway-host/src/logging.rs index 9147e833c..44b755d28 100644 --- a/backend/crates/gateway-host/src/logging.rs +++ b/backend/crates/gateway-host/src/logging.rs @@ -13,7 +13,7 @@ use tracing_subscriber::{Layer as _, layer::SubscriberExt as _, util::Subscriber use crate::config::LoggingConfig; const LOG_FILE_PREFIX: &str = "codex-proxy-rs"; -const OAUTH_RECOVERY_LOG_FILE_PREFIX: &str = "oauth"; +const OAUTH_RECOVERY_LOG_FILE_PREFIX: &str = "codex-proxy-rs-oath"; /// OAuth 恢复记录含原始 AT/RT,文件日志开启时必须落到独立文件。 const OAUTH_RECOVERY_LOG_TARGET: &str = "oauth_recovery"; diff --git a/backend/crates/gateway-host/tests/logging.rs b/backend/crates/gateway-host/tests/logging.rs index aff2df828..f7888ee5b 100644 --- a/backend/crates/gateway-host/tests/logging.rs +++ b/backend/crates/gateway-host/tests/logging.rs @@ -9,7 +9,7 @@ use gateway_host::system_update::SystemUpdateConfig; const LOG_DIRECTORY_ENV: &str = "CPR_LOGGING_TEST_DIRECTORY"; const CHILD_PROCESS_ENV: &str = "CPR_LOGGING_TEST_CHILD"; const APPLICATION_LOG_FILE_PREFIX: &str = "codex-proxy-rs."; -const OAUTH_RECOVERY_LOG_FILE_PREFIX: &str = "oauth."; +const OAUTH_RECOVERY_LOG_FILE_PREFIX: &str = "codex-proxy-rs-oath."; const APPLICATION_LOG_TARGET: &str = "logging_test_application"; const APPLICATION_LOG_MARKER: &str = "application-file-filter-test"; const OAUTH_RECOVERY_LOG_TARGET: &str = "oauth_recovery"; diff --git a/deploy/README.md b/deploy/README.md index 4f81b08f8..9007e8500 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -205,7 +205,7 @@ Release 必须提供当前 OS/架构的 `codex-proxy-rs___.ta `0700`(仅 `cpr` 用户可读写)。部署卷至少预留一个最大数据库归档的空间。 - OAuth 恢复记录通道使用 `oauth_recovery` 结构化日志事件;当前 OpenAI provider 每次成功取得 AT/RT 后,都会在账号资料补全、过期时间计算和数据库写入前写入独立的 - `oauth.YYYY-MM-DD[.N].log` 文件集。事件含原始 AT/RT,并以 `provider` + `codex-proxy-rs-oath.YYYY-MM-DD[.N].log` 文件集。事件含原始 AT/RT,并以 `provider` 字段标记来源,且与普通 `.runtime/logs` 完全相同地按日、按大小分割,并分别按相同 `retention_days` 与 `max_files` 清理;文件日志开启时不会被普通日志级别筛掉。它遵循普通日志现有的非阻塞写入机制,不会阻断 导入、授权或刷新。