docs/cli/logs.md
openclaw logsTail Gateway file logs over RPC (works in remote mode).
Related:
--limit <n>: maximum number of log lines to return (default 200)--max-bytes <n>: maximum bytes to read from the log file (default 250000)--follow: follow the log stream--interval <ms>: polling interval while following (default 1000)--json: emit line-delimited JSON events--plain: plain text output without styled formatting--no-color: disable ANSI colors--local-time: render timestamps in your local timezoneopenclaw logs also accepts the standard Gateway client flags:
--url <url>: Gateway WebSocket URL--token <token>: Gateway token--timeout <ms>: timeout in ms (default 30000)--expect-final: wait for a final response when the Gateway call is agent-backedWhen you pass --url, the CLI does not auto-apply config or environment credentials. Include --token explicitly if the target Gateway requires auth.
openclaw logs
openclaw logs --follow
openclaw logs --follow --interval 2000
openclaw logs --limit 500 --max-bytes 500000
openclaw logs --json
openclaw logs --plain
openclaw logs --no-color
openclaw logs --limit 500
openclaw logs --local-time
openclaw logs --follow --local-time
openclaw logs --url ws://127.0.0.1:18789 --token "$OPENCLAW_GATEWAY_TOKEN"
--local-time to render timestamps in your local timezone.logs.tail answers, openclaw logs falls back to the configured Gateway file log automatically. Explicit --url targets do not use this fallback.--follow, transient gateway disconnects (WebSocket close, timeout, connection drop) trigger automatic reconnection with exponential backoff (up to 8 retries, capped at 30 s between attempts). A warning is printed to stderr on each retry, and a [logs] gateway reconnected notice is printed once a poll succeeds. In --json mode both the retry warning and the reconnect transition are emitted as {"type":"notice"} records on stderr. Non-recoverable errors (auth failure, bad configuration) still exit immediately.