Logging (macOS)
Rolling diagnostics file log (Debug pane)
The macOS app logs through swift-log (unified logging by default) and can also write a rotating local file log for durable capture (DiagnosticsFileLog).
- Enable: Debug pane -> Logs -> App logging -> “Write rolling diagnostics log (JSONL)” (off by default).
- Verbosity: Debug pane -> Logs -> App logging -> Verbosity picker.
- Location:
~/Library/Logs/OpenClaw/diagnostics.jsonl. - Rotation: rotates at 5 MB; up to 5 backups suffixed
.1….5(oldest dropped). - Clear: Debug pane -> Logs -> App logging -> “Clear” deletes the active file and all backups.
Export unified logs as JSON
Run./scripts/clawlog.sh --json to write recent unified-log events as one JSON array to stdout, or add --output logs.json to write the array to a file without printing it. The default output contains the last 50 log records; use --lines 1 for the most recent record or --all for every matching record. --lines counts complete records in JSON mode, not physical lines.
JSON export cannot be combined with --follow or --list-categories. Use those options without --json.
App logger redaction
The macOS app’s swift-log bridge renders messages as text before handing them to unified logging or the optional file log. Its interpolation annotations are app-side rules, not native OSLog privacy metadata:privacy: .privatereplaces the value with<private>before either sink receives it.privacy: .private(mask: .hash)replaces the value with a keyed hash. Equal values correlate within one app process; hashes change when the app restarts.privacy: .public, unannotated interpolations, and swift-log metadata are not automatically redacted. Do not assume that a log is safe to share just because it came from unified logging.
Unified logging private data on macOS
Some shared components use native OSLog directly rather than the app’s swift-log bridge. Native OSLog normally redacts private values; explicitly public values remain visible. For those native events, a subsystem plist in/Library/Preferences/Logging/Subsystems/ can enable private-data capture. This is not a way to reveal the bridge’s <private> placeholders or hashes. Background: macOS logging privacy shenanigans.
Enable for OpenClaw (ai.openclaw)
Use this only when you need private values from native OSLog events. Check for an existing ai.openclaw.plist first and preserve it so you can restore the prior settings afterward. Write the plist to a temp file, then install it atomically as root:
./scripts/clawlog.sh --category WebChat --last 5m (--last/-l sets the time range, default 5m; --category/-c filters by category).
Disable after debugging
- If you created the plist for this capture, remove it:
sudo rm /Library/Preferences/Logging/Subsystems/ai.openclaw.plist. If it existed beforehand, restore the saved version instead. - The override can expose phone numbers and message bodies in native events. Keep it enabled only while needed; removing it does not erase data already captured.
- Turn off rolling file capture separately if you enabled it. The macOS override does not control that sink.