Skip to content

Log Files

NextDNS Blocker maintains several log files for monitoring, debugging, and auditing.

PlatformPath
macOS/Linux~/.local/share/nextdns-blocker/logs/
Windows%LOCALAPPDATA%\nextdns-blocker\logs\

Purpose: General application events

Contents:

  • Startup/shutdown
  • Configuration loading
  • Errors and warnings
  • Debug information (when verbose)

Example:

2024-01-15 14:30:00 INFO Starting sync
2024-01-15 14:30:01 INFO Loaded 5 domains from blocklist
2024-01-15 14:30:02 INFO Blocked reddit.com (outside schedule)
2024-01-15 14:30:02 INFO Sync complete: 1 blocked, 0 unblocked

Rotation: Daily, 7 days retention

Purpose: Security-relevant actions

Contents:

  • Domain blocks
  • Domain unblocks
  • Panic mode activation
  • Pending action creation/cancellation
  • Allowlist changes

Example:

2024-01-15 14:30:00 BLOCK reddit.com reason="outside schedule"
2024-01-15 18:00:00 UNBLOCK reddit.com reason="within schedule"
2024-01-15 20:00:00 PANIC_START duration=60 expires="2024-01-15 21:00:00"
2024-01-15 21:00:00 PANIC_END

Rotation: Weekly, 12 weeks retention

Purpose: Watchdog sync execution output

Contents:

  • Output from scheduled sync runs
  • Errors from cron/launchd/Task Scheduler
  • Timestamps of each run

Example:

=== 2024-01-15 14:30:00 ===
Syncing domains...
reddit.com: BLOCKED
Sync complete: 1 blocked, 0 unblocked
=== 2024-01-15 14:32:00 ===
Syncing domains...
Sync complete: 0 blocked, 0 unblocked

Rotation: Daily, 7 days retention

Purpose: Watchdog self-check events

Contents:

  • Watchdog status checks
  • Job restoration events
  • Self-healing activity

Example:

2024-01-15 14:35:00 CHECK Sync job exists: yes
2024-01-15 14:40:00 CHECK Sync job exists: yes
2024-01-15 14:45:00 RESTORE Sync job was missing, restored

Rotation: Daily, 7 days retention

Purpose: Detailed sync operation logs

Contents:

  • API calls made
  • Cache hits/misses
  • Schedule evaluations
  • Domain state changes

Rotation: Daily, 7 days retention

Terminal window
# macOS/Linux
tail -50 ~/.local/share/nextdns-blocker/logs/app.log
# Windows PowerShell
Get-Content "$env:LOCALAPPDATA\nextdns-blocker\logs\app.log" -Tail 50
Terminal window
# macOS/Linux
tail -f ~/.local/share/nextdns-blocker/logs/app.log
# Windows PowerShell
Get-Content "$env:LOCALAPPDATA\nextdns-blocker\logs\app.log" -Wait
Terminal window
# Find all blocks
grep BLOCK ~/.local/share/nextdns-blocker/logs/audit.log
# Find errors
grep ERROR ~/.local/share/nextdns-blocker/logs/app.log
# Find specific domain
grep reddit.com ~/.local/share/nextdns-blocker/logs/*.log
LevelDescription
DEBUGDetailed debugging (verbose mode)
INFONormal operation
WARNINGPotential issues
ERRORErrors that affect operation
CRITICALSevere errors
Terminal window
nextdns-blocker config push --verbose

NextDNS Blocker uses Python’s RotatingFileHandler:

  • Rotates when file exceeds size limit
  • Keeps specified number of backups

For system-level rotation, use logrotate (Linux):

/etc/logrotate.d/nextdns-blocker
/home/*/.local/share/nextdns-blocker/logs/*.log {
daily
rotate 7
compress
delaycompress
missingok
notifempty
create 0644
}

Run setup script:

Terminal window
chmod +x setup-logrotate.sh
./setup-logrotate.sh
Terminal window
# Count blocks today
grep "$(date +%Y-%m-%d)" ~/.local/share/nextdns-blocker/logs/audit.log | grep -c BLOCK
# Count unblocks this week
grep UNBLOCK ~/.local/share/nextdns-blocker/logs/audit.log | wc -l
Terminal window
# Most blocked domains
grep BLOCK ~/.local/share/nextdns-blocker/logs/audit.log | \
awk '{print $3}' | sort | uniq -c | sort -rn | head -10
# Panic mode usage
grep PANIC ~/.local/share/nextdns-blocker/logs/audit.log
Terminal window
# Actions in last hour
grep "$(date +%Y-%m-%d\ %H)" ~/.local/share/nextdns-blocker/logs/audit.log
# Weekend activity
grep -E "(Sat|Sun)" ~/.local/share/nextdns-blocker/logs/audit.log
  • Domain names
  • Timestamps
  • Action types
  • Error messages
  • API credentials
  • Full configuration
  • IP addresses
  • User data
Terminal window
# Clear all logs
rm ~/.local/share/nextdns-blocker/logs/*.log
# Clear old logs (keep last 3 days)
find ~/.local/share/nextdns-blocker/logs -name "*.log" -mtime +3 -delete
Terminal window
tail -100 ~/.local/share/nextdns-blocker/logs/cron.log

Look for:

  • API errors
  • Timeout messages
  • Configuration errors
Terminal window
tail -50 ~/.local/share/nextdns-blocker/logs/wd.log

Look for:

  • Job restoration events
  • Missing job warnings
Terminal window
# Enable verbose and capture
nextdns-blocker config push --verbose 2>&1 | tee debug.log

Share debug.log when reporting issues (redact API key).