Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
OpenClaw has two main log surfaces:
The Control UI Logs tab tails the gateway file log. This page explains where logs live, how to read them, and how to configure log levels and formats.
By default, the Gateway writes a rolling log file under:
/tmp/openclaw/openclaw-YYYY-MM-DD.logThe date uses the gateway host's local timezone.
Each file rotates when it reaches
logging.maxFileBytesopenclaw-YYYY-MM-DD.1.logYou can override this in
~/.openclaw/openclaw.jsonjson{ "logging": { "file": "/path/to/openclaw.log" } }
Use the CLI to tail the gateway log file via RPC:
bashopenclaw logs --follow
Useful current options:
--local-time--url <url>--token <token>--timeout <ms>--expect-finalOutput modes:
--json--plain--no-colorWhen you pass an explicit
--url--tokenIn JSON mode, the CLI emits
typemetalognoticerawIf the implicit local loopback Gateway asks for pairing, closes during connect, or times out before
logs.tailopenclaw logs--urlIf the Gateway is unreachable, the CLI prints a short hint to run:
bashopenclaw doctor
The Control UI’s Logs tab tails the same file using
logs.tailTo filter channel activity (WhatsApp/Telegram/etc), use:
bashopenclaw channels logs --channel whatsapp
Each line in the log file is a JSON object. The CLI and Control UI parse these entries to render structured output (time, level, subsystem, message).
File-log JSONL records also include machine-filterable top-level fields when available:
hostnamemessageagent_idsession_idchannelOpenClaw preserves the original structured log arguments alongside these fields so existing parsers that read numbered tslog argument keys keep working.
Console logs are TTY-aware and formatted for readability:
gateway/channels/whatsappConsole formatting is controlled by
logging.consoleStyleopenclaw gateway--verbose--ws-log auto|compact|full--compact--ws-log compactExamples:
bashopenclaw gateway openclaw gateway --verbose --ws-log compact openclaw gateway --verbose --ws-log full
All logging configuration lives under
logging~/.openclaw/openclaw.jsonjson{ "logging": { "level": "info", "file": "/tmp/openclaw/openclaw-YYYY-MM-DD.log", "consoleLevel": "info", "consoleStyle": "pretty", "redactSensitive": "tools", "redactPatterns": ["sk-.*"] } }
logging.levellogging.consoleLevelYou can override both via the OPENCLAW_LOG_LEVEL
OPENCLAW_LOG_LEVEL=debugopenclaw.json--log-level <level>openclaw --log-level debug gateway run--verboseFile logs are JSONL. When a log call carries a valid diagnostic trace context, OpenClaw writes the trace fields as top-level JSON keys (
traceIdspanIdparentSpanIdtraceFlagstraceparentGateway HTTP requests and Gateway WebSocket frames establish an internal request trace scope. Logs and diagnostic events emitted inside that async scope inherit the request trace when they do not pass an explicit trace context. Agent run and model-call traces become children of the active request trace, so local logs, diagnostic snapshots, OTEL spans, and trusted provider
traceparenttraceIdModel-call diagnostics record bounded request/response measurements without capturing raw prompt or response content:
requestPayloadBytesresponseStreamBytestimeToFirstByteMsdurationMsThese fields are available to diagnostic snapshots, model-call plugin hooks, and OTEL model-call spans/metrics when diagnostics export is enabled.
logging.consoleStyleprettycompactjsonOpenClaw can redact sensitive tokens before they hit console output, file logs, OTLP log records, persisted session transcript text, or Control UI tool event payloads (tool start args, partial/final result payloads, derived exec output, and patch summaries):
logging.redactSensitiveofftoolstoolslogging.redactPatternsFile logs and session transcripts stay JSONL, but matching secret values are masked before the line or message is written to disk. Redaction is best-effort: it applies to text-bearing message content and log strings, not every identifier or binary payload field.
The built-in defaults cover common API credentials and payment-credential field names such as card number, CVC/CVV, shared payment token, and payment credential when they appear as JSON fields, URL parameters, CLI flags, or assignments.
logging.redactSensitive: "off"sessions_historylogging.redactPatternsDiagnostics are structured, machine-readable events for model runs and message-flow telemetry (webhooks, queueing, session state). They do not replace logs — they feed metrics, traces, and exporters. Events are emitted in-process whether or not you export them.
Two adjacent surfaces:
logging.filelogging.leveltelegram.**diagnostics.flagsOPENCLAW_DIAGNOSTICS=...To enable diagnostics events for plugins or custom sinks without OTLP export:
json5{ diagnostics: { enabled: true }, }
For OTLP export to a collector, see OpenTelemetry export.
openclaw doctorlogging.filelogging.leveldebugtracediagnostics.*© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine