openclaw logs
View and follow OpenClaw Gateway logs in real-time.Usage
Options
Maximum lines to return per fetch (default: 200)
Maximum bytes to read per fetch (default: 250000)
Follow log output continuously (like
tail -f)Polling interval in milliseconds when following (default: 1000)
Output structured JSON log lines
Plain text output without ANSI styling
Disable ANSI colors
Display timestamps in local timezone instead of UTC
Gateway WebSocket URL (overrides config)
Gateway authentication token
RPC timeout in milliseconds
Examples
Log Format
Pretty Format (Default)
When connected to a TTY, logs are formatted for readability:TIME LEVEL MODULE MESSAGE
Plain Format
With--plain or when piped:
JSON Format
With--json:
Log Levels
Logs are categorized by severity:- trace: Detailed debug information
- debug: Debug messages
- info: Informational messages (default)
- warn: Warning messages
- error: Error messages
- fatal: Fatal errors
Level Colors
In pretty mode, levels are color-coded:- error/fatal: Red
- warn: Yellow
- info: Cyan
- debug/trace: Gray
Following Logs
Use--follow to continuously monitor logs:
tail -f, polling the gateway every second (configurable with --interval).
To stop following, press Ctrl+C.
Remote Gateway
To view logs from a remote gateway:Log Rotation
The gateway rotates log files automatically:- Maximum file size: 10 MB
- Keeps 5 rotated files
- Rotated files:
gateway.log.1,gateway.log.2, etc.
logs command:
- Detects the rotation
- Resets the cursor
- Continues from the new file
Structured Logging
Logs include structured metadata:--json to process structured logs with tools like jq:
Performance
Thelogs command:
- Fetches logs via Gateway RPC (requires running gateway)
- Uses cursor-based pagination for efficiency
- Streams output to avoid buffering
- Handles backpressure from slow terminals
Limits
- —limit: Controls lines per fetch (affects latency)
- —max-bytes: Prevents excessive memory usage
- —interval: Controls polling frequency when following
Troubleshooting
Gateway Not Reachable
If logs fail to connect:-
Check gateway status:
-
Verify gateway is running:
-
Check authentication:
-
Run diagnostics:
Log Truncation
If you see “Log tail truncated”:Broken Pipe
If piping to a command that exits early (likehead):
Alternative Log Access
Direct File Access
Logs are stored in:Platform-Specific Logs
macOS (Unified Logs)
Linux (systemd Journal)
Channel-Specific Logs
For channel-specific logs:Related Commands
- gateway - Manage the gateway
- daemon - Manage gateway service
- channels logs - View channel-specific logs
- status - Check system status

