Skip to content

High-frequency TRACE rows are still written to logs_2.sqlite with RUST_LOG=warn #30780

Closed as duplicate

Description

@BACON31

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 938 new TRACE rows, around 47 TRACE rows/sec.
  • A recent 5-minute query showed 1720 TRACE rows, with about 9653 KB estimated bytes.
  • The DB size was observed around 252,268,544 bytes, with WAL around 5,537,312 bytes.
  • The TRACE rows include targets / messages related to:
    • log
    • codex_api::sse::responses
    • codex_api::endpoint::responses_websocket
    • tokio-tungstenite WebSocket 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

  1. Set RUST_LOG=warn for the macOS user launch environment.
  2. Fully restart Codex.
  3. Confirm the running codex app-server process has RUST_LOG=warn.
  4. Query ~/.codex/logs_2.sqlite for recent rows by level.
  5. Observe continued high-frequency TRACE rows 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

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    app-serverIssues involving app server protocol or interfaces
    on Jul 1, 2026
  2. blick356 commented on Jul 2, 2026

    @blick356

    I can reproduce a similar high-frequency TRACE persistence issue on Windows with the Codex desktop app.

    Environment:

    • Platform: Windows 64-bit, Microsoft Windows NT 10.0.26200.0
    • Codex desktop app package/version observed: OpenAI.Codex_26.623.11225.0_x64__2p2nqsd0c76g0
    • Active backend process observed: WindowsApps package OpenAI.Codex_26.623.11225.0_x64__2p2nqsd0c76g0, binary app\resources\codex.exe
    • SQLite log DB: %USERPROFILE%\.codex\logs_2.sqlite
    • WAL file: %USERPROFILE%\.codex\logs_2.sqlite-wal

    Observed file sizes during the latest check:

    • logs_2.sqlite: 680,595,456 bytes
    • logs_2.sqlite-wal: 20,818,392 bytes
    • logs_2.sqlite-shm: 65,536 bytes

    Recent readonly sampling:

    • A 15-second SQLite sample showed max(id) increasing by 1085, around 71 rows/sec.
    • In the sampled new rows:
      • TRACE: 987 rows
      • DEBUG: 21 rows
      • INFO: 2 rows
    • Main TRACE target in that sample was log: 935 rows.
    • Other active targets included:
      • codex_app_server::outgoing_message
      • codex_api::sse::responses
      • hyper_util::client::legacy::*

    A later 5-minute readonly query showed:

    • TRACE: 1183 rows, estimated 613,129 bytes
    • DEBUG: 74 rows
    • INFO: 45 rows
    • WARN: 8 rows
    • ERROR: 3 rows

    Top targets in that 5-minute window:

    • TRACE log: 978 rows
    • TRACE codex_api::sse::responses: 135 rows
    • DEBUG codex_core::stream_events_utils: 71 rows
    • TRACE codex_mcp::connection_manager: 36 rows

    The 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.

  3. etraut-openai commented on Oct 13, 2026

    @etraut-openai
    Contributor

    (response from codex)

    Closing as a duplicate of #30236, which tracks persistent TRACE rows in logs_2.sqlite despite RUST_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appapp-serverIssues involving app server protocol or interfacesbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions