feat: add log db (#10086)

Add a log DB. The goal is just to store our logs in a `.sqlite` DB to
make it easier to crawl them and drop the oldest ones.
This commit is contained in:
jif-oai
2026-01-29 10:23:03 +01:00
committed by GitHub
parent 4d9ae3a298
commit 780482da84
12 changed files with 248 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ use codex_protocol::config_types::SandboxMode;
use codex_protocol::config_types::WindowsSandboxLevel;
use codex_protocol::protocol::RolloutItem;
use codex_protocol::protocol::RolloutLine;
use codex_state::log_db;
use codex_utils_absolute_path::AbsolutePathBuf;
use cwd_prompt::CwdPromptAction;
use cwd_prompt::CwdSelection;
@@ -351,10 +352,15 @@ pub async fn run_main(
let otel_tracing_layer = otel.as_ref().and_then(|o| o.tracing_layer());
let log_db_layer = codex_core::state_db::init_if_enabled(&config, None)
.await
.map(|db| log_db::start(db).with_filter(env_filter()));
let _ = tracing_subscriber::registry()
.with(file_layer)
.with(feedback_layer)
.with(feedback_metadata_layer)
.with(log_db_layer)
.with(otel_logger_layer)
.with(otel_tracing_layer)
.try_init();