Logging
Gateway logging configuration.
Log Location
Default: ~/.config/openclaw/logs/
Viewing Logs
bash
# Recent logs
openclaw logs
# Follow in real-time
openclaw logs -f
# Filter by level
openclaw logs --level errorLog Levels
| Level | Description |
|---|---|
debug | Detailed debugging |
info | General information |
warn | Warnings |
error | Errors |
Configuration
json5
{
logging: {
level: "info",
file: {
enabled: true,
path: "~/.config/openclaw/logs",
maxSize: "10MB",
maxFiles: 5
},
console: {
enabled: true,
colors: true
}
}
}Log Rotation
Logs are automatically rotated:
json5
{
logging: {
file: {
maxSize: "10MB", // Max file size
maxFiles: 5, // Number of files to keep
compress: true // Compress old logs
}
}
}Structured Logging
Enable JSON logging:
json5
{
logging: {
format: "json"
}
}Output:
json
{"timestamp":"2024-01-15T10:30:00Z","level":"info","message":"Gateway started","port":3000}