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).

The file log is a separate, explicit opt-in. Enabling it does not disable the app's interpolation redaction described below. It still includes public and unannotated messages, metadata, and direct diagnostic records, which can contain sensitive data. Enable it only while debugging, turn it off afterward, and review the active file and backups before sharing.

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:

This also protects private interpolations in strings that are concatenated before logging. Verbosity changes, file capture, and macOS private-data overrides cannot restore values removed by the app's bridge.

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 Apus (ai.apus)

Use this only when you need private values from native OSLog events. Check for an existing ai.apus.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:

cat <<'EOF' >/tmp/ai.apus.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>DEFAULT-OPTIONS</key>
    <dict>
        <key>Enable-Private-Data</key>
        <true/>
    </dict>
</dict>
</plist>
EOF
sudo install -m 644 -o root -g wheel /tmp/ai.apus.plist /Library/Preferences/Logging/Subsystems/ai.apus.plist

Enable the override before reproducing the issue: it affects new native OSLog events, not entries already collected. Inspect the output with ./scripts/clawlog.sh --category WebChat --last 5m (--last/-l sets the time range, default 5m; --category/-c filters by category).

Disable after debugging

Related