Log retention
This page is for administrators and hosting teams. Logs contain personal data (masked addresses, user agents, URLs). Exponential rotates every log by size; only the request logs have age limits by default. The project lists "logs without an age limit by default" as a known gap (Privacy standards: Known gaps).
Note This page describes features and common practice; it is not legal advice. Check the law that applies to your organization with your legal counsel.
Contents
- How rotation works
- The defaults
- Setting age limits
- Pruning on a schedule
- Logs outside Exponential
- Related pages
How rotation works
When a log outgrows site.ini [FileSettings] LogFileMaxSize (2 MB), the next write rotates it: .1 becomes .2 and
so on, and archives beyond LogFileRotateCount (3) are removed. A prune removes archives beyond the count and
older than the age limit; a rotation never removes by age
(Log rotation).
The defaults
| Log | Archives | Age limit |
|---|---|---|
404.log | 5, compressed, 10 MB each | 30 days |
security.log | 5, compressed, 10 MB each | 90 days |
csp.log | 5, compressed, 10 MB each | 30 days |
error.log, warning.log, notice.log, debug.log, auth.log, storage.log, cronjob and extension logs | 3, by size | none (LogFileMaxAge=0) |
Setting age limits
Per log, by its key (the key of the log viewer's permalinks, such as error, auth, site-storage):
# settings/override/logviewer.ini.append.php
[RotationSettings]
MaxAgeDays[error]=90
MaxAgeDays[auth]=90
MaxAgeDays[notice]=30
Compress[error]=enabledor one limit for every log without its own entry, in settings/override/site.ini.append.php:
[FileSettings]
LogFileMaxAge=90Choose the values with your DPO: long enough to investigate incidents, short enough for storage limitation.
Pruning on a schedule
Age limits act when a prune runs:
./console exp:logs --archives --allow-root-user # each log, its archives, sizes and limits
./console exp:logs --prune --dry-run --allow-root-user # what would go
./console exp:logs --apply --prune --allow-root-user # remove itOr the cronjob part logs (in no default group, so add it), as the site's user:
15 3 * * * cd /path/to/exponential && php runcronjobs.php -q logsRotations and prunes are recorded in the audit as system.log.rotate and system.log.delete. If the system's
logrotate manages var/log instead, set LogFileRotateCount=0 so the kernel does not rotate as well.
Logs outside Exponential
The web server's and PHP-FPM's logs, Velocity's logs and the mail server's logs are rotated by their own programs; set
their retention there or ask your host. request-shield's log (var/request-shield/log/shield.log) is rotated by the
shield at the size its rule file sets (log-max-size).
Related pages
- Log rotation and pruning
- Masking in logs and the log viewer
- Log and data retention for hosts
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.