Files
openclaw-skill/openclaw-knowhow-skill/output/openclaw-docs_data/pages/Logging_d0aab3b849.json
Selig 4c966a3ad2 Initial commit: OpenClaw Skill Collection
6 custom skills (assign-task, dispatch-webhook, daily-briefing,
task-capture, qmd-brain, tts-voice) with technical documentation.
Compatible with Claude Code, OpenClaw, Codex CLI, and OpenCode.
2026-03-13 10:58:30 +08:00

39 lines
5.1 KiB
JSON
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"title": "Logging",
"content": "For a user-facing overview (CLI + Control UI + config), see [/logging](/logging).\n\nOpenClaw has two log surfaces:\n\n* **Console output** (what you see in the terminal / Debug UI).\n* **File logs** (JSON lines) written by the gateway logger.\n\n* Default rolling log file is under `/tmp/openclaw/` (one file per day): `openclaw-YYYY-MM-DD.log`\n * Date uses the gateway host's local timezone.\n* The log file path and level can be configured via `~/.openclaw/openclaw.json`:\n * `logging.file`\n * `logging.level`\n\nThe file format is one JSON object per line.\n\nThe Control UI Logs tab tails this file via the gateway (`logs.tail`).\nCLI can do the same:\n\n**Verbose vs. log levels**\n\n* **File logs** are controlled exclusively by `logging.level`.\n* `--verbose` only affects **console verbosity** (and WS log style); it does **not**\n raise the file log level.\n* To capture verbose-only details in file logs, set `logging.level` to `debug` or\n `trace`.\n\nThe CLI captures `console.log/info/warn/error/debug/trace` and writes them to file logs,\nwhile still printing to stdout/stderr.\n\nYou can tune console verbosity independently via:\n\n* `logging.consoleLevel` (default `info`)\n* `logging.consoleStyle` (`pretty` | `compact` | `json`)\n\n## Tool summary redaction\n\nVerbose tool summaries (e.g. `🛠 Exec: ...`) can mask sensitive tokens before they hit the\nconsole stream. This is **tools-only** and does not alter file logs.\n\n* `logging.redactSensitive`: `off` | `tools` (default: `tools`)\n* `logging.redactPatterns`: array of regex strings (overrides defaults)\n * Use raw regex strings (auto `gi`), or `/pattern/flags` if you need custom flags.\n * Matches are masked by keeping the first 6 + last 4 chars (length >= 18), otherwise `***`.\n * Defaults cover common key assignments, CLI flags, JSON fields, bearer headers, PEM blocks, and popular token prefixes.\n\n## Gateway WebSocket logs\n\nThe gateway prints WebSocket protocol logs in two modes:\n\n* **Normal mode (no `--verbose`)**: only interesting RPC results are printed:\n * errors (`ok=false`)\n * slow calls (default threshold: `>= 50ms`)\n * parse errors\n* **Verbose mode (`--verbose`)**: prints all WS request/response traffic.\n\n`openclaw gateway` supports a per-gateway style switch:\n\n* `--ws-log auto` (default): normal mode is optimized; verbose mode uses compact output\n* `--ws-log compact`: compact output (paired request/response) when verbose\n* `--ws-log full`: full per-frame output when verbose\n* `--compact`: alias for `--ws-log compact`",
"code_samples": [
{
"code": "**Verbose vs. log levels**\n\n* **File logs** are controlled exclusively by `logging.level`.\n* `--verbose` only affects **console verbosity** (and WS log style); it does **not**\n raise the file log level.\n* To capture verbose-only details in file logs, set `logging.level` to `debug` or\n `trace`.\n\n## Console capture\n\nThe CLI captures `console.log/info/warn/error/debug/trace` and writes them to file logs,\nwhile still printing to stdout/stderr.\n\nYou can tune console verbosity independently via:\n\n* `logging.consoleLevel` (default `info`)\n* `logging.consoleStyle` (`pretty` | `compact` | `json`)\n\n## Tool summary redaction\n\nVerbose tool summaries (e.g. `🛠 Exec: ...`) can mask sensitive tokens before they hit the\nconsole stream. This is **tools-only** and does not alter file logs.\n\n* `logging.redactSensitive`: `off` | `tools` (default: `tools`)\n* `logging.redactPatterns`: array of regex strings (overrides defaults)\n * Use raw regex strings (auto `gi`), or `/pattern/flags` if you need custom flags.\n * Matches are masked by keeping the first 6 + last 4 chars (length >= 18), otherwise `***`.\n * Defaults cover common key assignments, CLI flags, JSON fields, bearer headers, PEM blocks, and popular token prefixes.\n\n## Gateway WebSocket logs\n\nThe gateway prints WebSocket protocol logs in two modes:\n\n* **Normal mode (no `--verbose`)**: only interesting RPC results are printed:\n * errors (`ok=false`)\n * slow calls (default threshold: `>= 50ms`)\n * parse errors\n* **Verbose mode (`--verbose`)**: prints all WS request/response traffic.\n\n### WS log style\n\n`openclaw gateway` supports a per-gateway style switch:\n\n* `--ws-log auto` (default): normal mode is optimized; verbose mode uses compact output\n* `--ws-log compact`: compact output (paired request/response) when verbose\n* `--ws-log full`: full per-frame output when verbose\n* `--compact`: alias for `--ws-log compact`\n\nExamples:",
"language": "unknown"
}
],
"headings": [
{
"level": "h2",
"text": "File-based logger",
"id": "file-based-logger"
},
{
"level": "h2",
"text": "Console capture",
"id": "console-capture"
},
{
"level": "h2",
"text": "Tool summary redaction",
"id": "tool-summary-redaction"
},
{
"level": "h2",
"text": "Gateway WebSocket logs",
"id": "gateway-websocket-logs"
},
{
"level": "h3",
"text": "WS log style",
"id": "ws-log-style"
}
],
"url": "llms-txt#logging",
"links": []
}