Repository navigation
High-frequency TRACE rows are still written to logs_2.sqlite with RUST_LOG=warn #30780
Description
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.
Activity
github-actions commentedon Jul 1, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
blick356 commentedon Jul 2, 2026
I can reproduce a similar high-frequency TRACE persistence issue on Windows with the Codex desktop app.
Environment:
Microsoft Windows NT 10.0.26200.0OpenAI.Codex_26.623.11225.0_x64__2p2nqsd0c76g0OpenAI.Codex_26.623.11225.0_x64__2p2nqsd0c76g0, binaryapp\resources\codex.exe%USERPROFILE%\.codex\logs_2.sqlite%USERPROFILE%\.codex\logs_2.sqlite-walObserved file sizes during the latest check:
logs_2.sqlite:680,595,456byteslogs_2.sqlite-wal:20,818,392byteslogs_2.sqlite-shm:65,536bytesRecent readonly sampling:
max(id)increasing by1085, around71 rows/sec.TRACE:987rowsDEBUG:21rowsINFO:2rowslog:935rows.codex_app_server::outgoing_messagecodex_api::sse::responseshyper_util::client::legacy::*A later 5-minute readonly query showed:
TRACE:1183rows, estimated613,129bytesDEBUG:74rowsINFO:45rowsWARN:8rowsERROR:3rowsTop targets in that 5-minute window:
TRACElog:978rowsTRACEcodex_api::sse::responses:135rowsDEBUGcodex_core::stream_events_utils:71rowsTRACEcodex_mcp::connection_manager:36rowsThe WAL file modification time keeps refreshing during normal active use, and checkpoint/writeback periodically updates the main SQLite DB as well. I am intentionally not attaching log bodies because they may contain sensitive session content.
This looks like the same class of issue reported here: high-frequency TRACE rows are persisted into the local SQLite log store during normal desktop app usage. It would be very helpful to have a supported way to disable TRACE persistence, lower the persisted log level, cap retention more aggressively, or move this log store to a configurable location.
etraut-openai commentedon Oct 13, 2026
(response from codex)
Closing as a duplicate of #30236, which tracks persistent TRACE rows in
logs_2.sqlitedespiteRUST_LOG=warn, including the write-rate and sink-control concerns. Your Mac measurements and the Windows follow-up are useful linked examples. Please follow #30236 for further investigation.