Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,155 of 9,155 pages
About the help in other languages
All help pages

Log retention and rotation

How long Exponential keeps its logs and audit records by default, how rotation, compression and pruning work, how to set retention per log to match a public body's records and data protection rules, and how to keep the…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/government/operations/monitoring/log-retention-and-rotation.md

On this page

Log retention and rotation

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.

This page is for administrators, records officers and data protection staff who must keep logs long enough for security and audit, and no longer than allowed. Sources: Log rotation and pruning, Audit trail and Log and data retention (hosting).

Contents

  1. The defaults
  2. Setting retention per log
  3. The audit trail's own retention
  4. Rotation on demand and by cron
  5. Deciding your periods
  6. Related pages

The defaults

LogDefaultSource
error.log, warning.log, debug.log, storage.log, cronjob and extension logsrotated at 2 MB, 3 archives, no age limitsite.ini [FileSettings] LogFileMaxSize, LogFileRotateCount, LogFileMaxAge=0
404.log10 MB, 5 archives, compressed, pruned after 30 dayslogviewer.ini [RotationSettings]
security.log10 MB, 5 archives, compressed, pruned after 90 daysthe same
csp.log10 MB, 5 archives, compressed, pruned after 30 daysthe same
Audit channels content, access, system, commerce90 days live, 730 days archivedsettings/audit.ini
Audit channel read (only when reads are on)30 days live, 90 archivedthe same

With the defaults a kernel log takes at most about 8 MB on disk. Note that size-based rotation alone keeps logs for however long 3 archives last, which on a busy site can be days, on a quiet one months.

Setting retention per log

# settings/override/logviewer.ini.append.php
[RotationSettings]
MaxSize[error]=10485760
Keep[error]=10
Compress[error]=enabled
MaxAgeDays[error]=180

Keep sets the number of archives, MaxAgeDays an age limit applied when pruning. Logs without an entry use the site.ini [FileSettings] values. Log health shows the settings in effect for each log and where each comes from.

The audit trail's own retention

Per channel in settings/override/audit.ini.append.php: LiveDays, ArchiveDays, MaxFileSize, ArchiveFormat. Archives are compressed, read back and compared before the live file goes, and listed in a signed manifest. Privacy tools (pseudonymization, purge) are in the audit guide, section 4.12.

Rotation on demand and by cron

./console exp:logs --archives                # each log, its archives, sizes and limits
./console exp:logs --rotate-all --dry-run    # what would be rotated
./console exp:logs --prune --dry-run         # archives beyond Keep and MaxAgeDays
./console exp:logs --apply --prune                   # remove them

The cronjob part logs (in no default part) rotates, prunes and compresses on a schedule: php runcronjobs.php -q logs. Rotations and prunes are recorded as system.log.rotate and system.log.delete. If the system's logrotate manages var/log instead, set LogFileRotateCount=0 so the two do not both rotate.

Deciding your periods

ConsiderationPoints toward
Investigating incidents found latelonger security.log and audit access retention
Data protection (addresses, user agents, even masked)shorter request log retention
Records rules for decisions and publicationsaudit content channel and version history, not the technical logs
Disk budgetLog health, DiskBudget

Write the periods into your records schedule and configure them in settings under change control.

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.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x