* refactor(config): consolidate media model lists * refactor(config): unify memory configuration * refactor(config): consolidate TTS ownership * refactor(config): move typing policy to agents * refactor(config): retire product-level config surfaces * refactor(config): share scoped tool policy type * chore(config): refresh generated baselines * fix(config): honor agent typing overrides * fix(config): migrate sibling config consumers * refactor(infra): keep base64url decoder private * fix(config): strip invalid legacy TTS values * chore(config): refresh rebased baseline hash * fix(doctor): route legacy messages.tts.realtime voice to talk during tts move * refactor(config): polish final layout names * refactor(config): freeze retired tuning defaults * feat(config): add fast mode default symmetry * refactor(config): key agent entries by id * docs(config): update final layout reference * test(config): cover final layout migrations * chore(config): refresh final layout baselines * fix(config): align final layout runtime readers * fix(config): align remaining readers * fix(config): stabilize final layout migrations * fix(config): finalize config projection proof * fix(config): address final layout review * docs(release): preserve historical config names * fix(config): complete keyed agent migration * fix(config): close final migration gaps * fix(config): finish full-branch review * fix(config): complete runtime secret detection * fix(config): close final review findings * fix(config): finish canonical docs and heartbeat migration * fix(config): integrate latest main after rebase * refactor(env): isolate test-only controls * refactor(env): isolate build and development controls * refactor(env): collapse process identity indirection * refactor(env): remove duplicate config and temp aliases * docs(env): define the operator-facing allowlist * ci(env): ratchet production variable count * fix(env): remove stale provider helper import * fix(env): make ratchet sorting explicit * test(env): keep test seam in dead-code audit * test(env): cover ratchet growth and boundary; document surface budgets * docs(config): document tier-eval consolidations * docs(config): clarify speech preference ownership * test(memory): align retired tuning fixtures * refactor(memory): freeze engine heuristics * refactor(config): apply tier-eval tranche * refactor(tts): move persona shaping to providers * refactor(compaction): move prompt policy to providers * test(config): align hookified prompt fixtures * chore(deadcode): classify test-only exports * chore(github): remove unused spawn helper * chore(deadcode): classify queue diagnostics * chore(deadcode): remove unused lane snapshot export * chore(plugin-sdk): ratchet consolidated surface * fix(config): integrate latest main after rebase
6.0 KiB
summary, read_when, title
| summary | read_when | title | ||
|---|---|---|---|---|
| Logging surfaces, file logs, WS log styles, and console formatting |
|
Gateway logging |
Logging
For a user-facing overview (CLI + Control UI + config), see /logging.
OpenClaw has two log surfaces:
- Console output - what you see in the terminal / Debug UI.
- File logs - JSON lines written by the gateway logger.
At startup, the Gateway logs the resolved default agent model plus the mode defaults that affect new sessions:
agent model: openai/gpt-5.6-sol (thinking=medium, fast=on)
thinking comes from the default agent, model params, or the global agent default; when unset it shows medium. fast comes from the default agent or the model's fastMode params.
File-based logger
- Default rolling log file is under
/tmp/openclaw/(one file per day):openclaw-YYYY-MM-DD.log, dated by the gateway host's local timezone. If that directory is unsafe or unwritable (wrong owner, world-writable, a symlink), OpenClaw falls back to a user-scopedos.tmpdir()/openclaw-<uid>path instead; on Windows it always uses that OS-tmpdir fallback. - Active log files rotate at
logging.maxFileBytes(default: 100 MB), keeping up to five numbered archives (.1through.5) and continuing to write a fresh active file. - Configure the log file path and level via
~/.openclaw/openclaw.json:logging.file,logging.level. - The file format is one JSON object per line.
Talk, realtime voice, and managed-room code paths use the shared file logger for bounded lifecycle records intended for operational debugging and OTLP log export. Transcript text, audio payloads, turn ids, call ids, and provider item ids are never copied into the log record.
The Control UI Logs tab tails this file via the gateway (logs.tail). The CLI does the same:
openclaw logs --follow
Verbose vs. log levels
- File logs are controlled exclusively by
logging.level. --verboseonly affects console verbosity (and WS log style) - it does not raise the file log level.- To capture verbose-only details in file logs, set
logging.leveltodebugortrace. - Trace logging also includes diagnostic timing summaries for selected hot paths, such as plugin tool factory preparation. See /tools/plugin#slow-plugin-tool-setup.
Console capture
The CLI captures console.log/info/warn/error/debug/trace, writes them to file logs, and still prints to stdout/stderr.
Tune console verbosity independently:
logging.consoleLevel(defaultinfo)logging.consoleStyle(pretty|compact|json; defaults toprettyon a TTY,compactotherwise)
Redaction
OpenClaw masks sensitive tokens before log or transcript output leaves the process. This redaction policy applies at console, file-log, OTLP log-record, and session transcript text sinks, so matching secret values are masked before JSONL lines or messages are written to disk.
- Sensitive-value redaction is always enabled.
logging.redactPatterns: array of regex strings (overrides defaults)- Use raw regex strings (auto
gi), or/pattern/flagsfor custom flags. - Matches are masked keeping the first 6 + last 4 chars (values >= 18 chars); shorter values become
***. - Defaults cover common key assignments, CLI flags, JSON fields, bearer headers, PEM blocks, popular vendor token prefixes, and payment credential field names (card number, CVC/CVV, shared payment token, payment credential).
- Use raw regex strings (auto
Safety boundaries such as Control UI tool-call events, sessions_history output, diagnostics exports, provider errors, exec approval display, and Gateway WebSocket logs always redact. logging.redactPatterns adds deployment-specific patterns.
Gateway WebSocket logs
The gateway prints WebSocket protocol logs in two modes:
- Normal mode (no
--verbose): only "interesting" RPC results print - errors (ok=false), slow calls (default threshold:>= 50ms), and parse errors. - Verbose mode (
--verbose): prints all WS request/response traffic.
WS log style
openclaw gateway supports a per-gateway style switch:
--ws-log auto(default): normal mode is optimized; verbose mode uses compact output.--ws-log compact: compact output (paired request/response) when verbose.--ws-log full: full per-frame output when verbose.--compact: alias for--ws-log compact.
# optimized (only errors/slow)
openclaw gateway
# show all WS traffic (paired)
openclaw gateway --verbose --ws-log compact
# show all WS traffic (full meta)
openclaw gateway --verbose --ws-log full
Console formatting (subsystem logging)
The console formatter is TTY-aware and prints consistent, prefixed lines. Subsystem loggers keep output grouped and scannable:
- Subsystem prefixes on every line (e.g.
[gateway],[canvas],[tailscale]). - Subsystem colors (stable per subsystem, hashed from the name) plus level coloring.
- Color when output is a TTY or the environment looks like a rich terminal (
TERM/COLORTERM/TERM_PROGRAM); respectsNO_COLORandFORCE_COLOR. - Shortened subsystem prefixes: drops a leading
gateway/,channels/, orproviders/segment, then keeps at most the last 2 remaining segments (e.g.channels/turn/kerneldisplays asturn/kernel). Known channel subsystems (telegram,whatsapp,slack, etc.) always collapse to just the channel name. - Sub-loggers by subsystem (auto prefix + structured field
{ subsystem }). logRaw()for QR/UX output (no prefix, no formatting).- Console styles:
pretty|compact|json. - Console log level is separate from file log level (file keeps full detail when
logging.levelisdebug/trace). - WhatsApp message bodies log at
debug(use--verboseto see them).
This keeps file logs stable while making interactive output scannable.