Log Archival & Retention¶
LuceDev Syslog automatically manages log storage through configurable retention and optional archival.
How Retention Works¶
A cleanup job runs every hour. It checks the Keep Logs For value in Settings → Database and removes any logs older than that threshold.
- Range: 7 to 90 days
- Default: 30 days
- Changes take effect at the next hourly cleanup cycle — no restart required
Archival¶
When Archive Before Deleting is enabled (default), old logs are compressed to .csv.gz files before being removed from the database. Archives are organized by month.
Each archive file contains all log fields: timestamp, host, facility, severity, and message.
Archive Location¶
Archives are stored in:
Managing Archives¶
From Settings → Database, you can:
- Download any archive file
- Delete archives you no longer need
- Run Archive Now to trigger archival manually
Storage Estimates¶
| Logs Per Day | 30-Day DB Size | Monthly Archive |
|---|---|---|
| 100,000 | ~50 MB | ~3 MB compressed |
| 500,000 | ~250 MB | ~15 MB compressed |
| 1,000,000 | ~500 MB | ~30 MB compressed |
| 2,000,000 | ~1 GB | ~60 MB compressed |
These are estimates. Actual sizes depend on average message length.
SSD Recommended
For volumes above 500K logs/day, an SSD is strongly recommended for optimal dashboard performance.
Database Maintenance¶
Admins can run maintenance operations from the dashboard API:
- VACUUM — Reclaims disk space from deleted logs
- ANALYZE — Updates query planner statistics for faster queries
- Rebuild Stats — Rebuilds the hourly statistics table used for charts
These run automatically during normal operation but can be triggered manually if needed.