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

Set log retention

Step by step - give Exponential's kernel logs an age limit with MaxAgeDays per log (404, security and CSP have one already), schedule pruning with the logs cronjob part, and check with a dry run.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/government/tasks/compliance/set-log-retention.md

On this page

Set log retention

For administrators. Apart from 404.log (30 days), security.log (90) and csp.log (30), kernel logs are rotated by size only and have no age limit by default (Log retention).

Contents

  1. Before you start
  2. Steps
  3. Check that it worked
  4. Related pages

Before you start

  • The periods decided with your DPO and security officer (long enough for investigations).
  • The log keys: see Setup > Log files (the key is in each log's permalink, setup/logs/view/<key>), or ./console exp:logs --archives --allow-root-user.

Steps

  1. In settings/override/logviewer.ini.append.php:

    [RotationSettings]
    MaxAgeDays[error]=90
    MaxAgeDays[warning]=30
    MaxAgeDays[notice]=30
    MaxAgeDays[auth]=90
    Compress[error]=enabled

    or one default for every log without its own entry in settings/override/site.ini.append.php: [FileSettings] LogFileMaxAge=90.

  2. Schedule pruning: add the cronjob part logs to the site user's crontab, for example 15 3 * * * cd /path/to/exponential && php runcronjobs.php -q logs.

  3. Clear the INI cache.

Check that it worked

./console exp:logs --archives --allow-root-user          # shows the limits per log
./console exp:logs --prune --dry-run --allow-root-user   # what would go now

After the first night, the audit shows system.log.delete for pruned archives.

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