squirrelscan
GitHub

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

LevelWhat’s Logged
errorExceptions, 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 debug

Valid values: error, warn, info, debug

Environment variable

Override the setting for a single run:

SQUIRREL_LOG_LEVEL=debug squirrel audit https://nutshop.squirrelscan.com

The 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 --debug

This is useful for real-time debugging without changing your log level setting.

Log files

Logs are written to ~/.squirrel/logs/:

FileContents
debug.logCurrent log file (all enabled levels)
trace.logPerformance traces (when --trace enabled)
debug.log.*.gzRotated/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:

SettingDefaultDescription
log_compress_after_days14Compress .log files older than N days
log_delete_after_days60Delete .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