fix(logging): rotate file logs instead of suppressing

This commit is contained in:
Vincent Koc
2026-04-25 22:50:38 -07:00
parent e54f5c4068
commit cd89adf0ac
10 changed files with 155 additions and 52 deletions

View File

@@ -858,7 +858,7 @@ Notes:
- Default log file: `/tmp/openclaw/openclaw-YYYY-MM-DD.log`.
- Set `logging.file` for a stable path.
- `consoleLevel` bumps to `debug` when `--verbose`.
- `maxFileBytes`: maximum log file size in bytes before writes are suppressed (positive integer; default: `524288000` = 500 MB). Use external log rotation for production deployments.
- `maxFileBytes`: maximum active log file size in bytes before rotation (positive integer; default: `104857600` = 100 MB). OpenClaw keeps up to five numbered archives beside the active file.
---

View File

@@ -19,6 +19,8 @@ OpenClaw has two log “surfaces”:
- Default rolling log file is under `/tmp/openclaw/` (one file per day): `openclaw-YYYY-MM-DD.log`
- Date uses the gateway host's local timezone.
- Active log files rotate at `logging.maxFileBytes` (default: 100 MB), keeping
up to five numbered archives and continuing to write a fresh active file.
- The log file path and level can be configured via `~/.openclaw/openclaw.json`:
- `logging.file`
- `logging.level`

View File

@@ -23,6 +23,11 @@ By default, the Gateway writes a rolling log file under:
The date uses the gateway host's local timezone.
Each file rotates when it reaches `logging.maxFileBytes` (default: 100 MB).
OpenClaw keeps up to five numbered archives beside the active file, such as
`openclaw-YYYY-MM-DD.1.log`, and keeps writing to a fresh active log instead of
suppressing diagnostics.
You can override this in `~/.openclaw/openclaw.json`:
```json