Debug and tracing
Configure debug logging and performance tracing
SquirrelScan writes debug logs to ~/.squirrel/logs/ for diagnosing issues. By default, only errors are logged. Increase the log level for more detail.
Log levels
| Level | What’s Logged |
|---|---|
error | Exceptions, command failures, fatal errors (default) |
warn | + warnings, recoverable issues |
info | + command start/end, crawl lifecycle events |
debug | + every HTTP request, rule execution details |
Configuration
Settings file
squirrel config set log_level debugValid values: error, warn, info, debug
Environment variable
Override the setting for a single run:
SQUIRREL_LOG_LEVEL=debug squirrel audit https://nutshop.squirrelscan.comThe environment variable takes precedence over the settings file.
Console debug flag
The --debug flag shows debug messages in the console, independent of file logging:
squirrel audit https://nutshop.squirrelscan.com --debugThis is useful for real-time debugging without changing your log level setting.
Log files
Logs are written to ~/.squirrel/logs/:
| File | Contents |
|---|---|
debug.log | Current log file (all enabled levels) |
trace.log | Performance traces (when --trace enabled) |
debug.log.*.gz | Rotated/compressed old logs |
Log format
2026-11-16T23:32:51.084Z [debug] request {"url":"http://nutshop.squirrelscan.com/","method":"HEAD","status":301,"ttfb":28}
2026-11-16T23:32:51.128Z [debug] request {"url":"https://nutshop.squirrelscan.com/","method":"HEAD","status":200,"ttfb":44}
2026-11-16T23:32:52.093Z [info] ========== COMMAND END: audit (success, 5698ms) ==========Log rotation
Logs rotate automatically:
| Setting | Default | Description |
|---|---|---|
log_compress_after_days | 14 | Compress .log files older than N days |
log_delete_after_days | 60 | Delete .gz files older than N days |
Size-based rotation also triggers at 10MB to prevent runaway growth.
Configure via settings:
squirrel config set log_compress_after_days 7
squirrel config set log_delete_after_days 30