High-frequency TRACE rows are still written to logs_2.sqlite with RUST_LOG=warn
Summary
Codex app-server appears to keep writing high-frequency TRACE rows into ~/.codex/logs_2.sqlite even when the running codex app-server process has RUST_LOG=warn in its environment.
I am reporting this because I rely on Codex heavily for daily work and genuinely want to keep using it. Seeing a local SQLite log file receive continuous high-frequency TRACE writes makes me worried about unnecessary SSD wear and makes it harder to feel comfortable leaving Codex open for long sessions.
Environment
- Platform: macOS
- Codex CLI version:
codex-cli 0.142.4 - Running server command observed:
/Applications/Codex.app/Contents/Resources/codex app-server --analytics-default-enabled - Process environment confirmed:
RUST_LOG=warn - SQLite log DB:
~/.codex/logs_2.sqlite
Observed behavior
After setting RUST_LOG=warn via launchctl setenv RUST_LOG warn, fully restarting Codex, and confirming the running codex app-server process environment shows RUST_LOG=warn, ~/.codex/logs_2.sqlite still receives many TRACE rows during normal use.
Recent measurements from my machine:
- A quiet 20-second sample showed about
938newTRACErows, around47 TRACE rows/sec. - A recent 5-minute query showed
1720TRACE rows, with about9653 KBestimated bytes. - The DB size was observed around
252,268,544bytes, with WAL around5,537,312bytes. - The TRACE rows include targets / messages related to:
logcodex_api::sse::responsescodex_api::endpoint::responses_websockettokio-tungsteniteWebSocket frame/read/decompress style logs
Example recent TRACE message prefixes included WebSocket frame parsing, read/poll calls, and response/SSE messages. I am not attaching full log bodies because they may contain sensitive session content.
Expected behavior
When RUST_LOG=warn is active for codex app-server, I would expect TRACE-level diagnostic details not to be persisted continuously into the local SQLite log store.
If this SQLite log store is intentionally separate from RUST_LOG, it would be very helpful to have a supported setting to disable TRACE persistence, lower the persisted level, cap retention more aggressively, or move the store to a user-configurable location.
Why this matters
I understand this may not immediately damage an SSD, but the constant write activity is concerning for users who keep Codex open and depend on it for long working sessions. Codex is becoming important to my workflow, so I want to be able to trust that leaving it open is not causing unnecessary disk writes.
Reproduction outline
- Set
RUST_LOG=warnfor the macOS user launch environment. - Fully restart Codex.
- Confirm the running
codex app-serverprocess hasRUST_LOG=warn. - Query
~/.codex/logs_2.sqlitefor recent rows by level. - Observe continued high-frequency
TRACErows during normal active use.
Useful checks:
SELECT level, COUNT(*) AS rows, ROUND(SUM(estimated_bytes)/1024.0, 1) AS estimated_kb
FROM logs
WHERE ts >= strftime('%s','now') - 300
GROUP BY level
ORDER BY rows DESC;
SELECT target, level, COUNT(*) AS rows, ROUND(SUM(estimated_bytes)/1024.0, 1) AS estimated_kb
FROM logs
WHERE ts >= strftime('%s','now') - 300
GROUP BY target, level
ORDER BY rows DESC
LIMIT 20;
Thanks for looking into this. I really like and depend on Codex; I am mainly hoping there can be a way to keep using it confidently without worrying about high-frequency local TRACE writes.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗