- Plesk 12.5 for Linux
- Plesk 12.5 for Windows
- Plesk Onyx for Linux
- Plesk Onyx for Windows
How to manage log rotation for a domain in Plesk?
Log rotation management can be done either via Plesk or a command-line interface. Both methods are described below.
Managing log rotation via Plesk
In Plesk go to Domains > example.com > Logs > click the button > Manage Log Files.
Click Log Rotation.
In the opened window, configure the required parameters. Once done, click OK to apply the changes.
When Log rotation is disabled, each logfile will be kept forever.
When the Maximum number of log files is set to 0, all existing logfiles will be deleted after log rotation condition.
ModSecurity logfiles are rotated by size only.
Managing log rotation via a command-line interface
- -log-rotate <true|false> - Log rotation status (default: true)
- -log-bysize <number>[B|K|M|G] - Enables log rotation by size
- -log-bytime <daily|weekly|monthly> - Enables log rotation by time (default: daily)
- -log-max-num-files <number> - Maximum number of log files to store
- -log-compress <true|false> - Log files compression (default: true)
- -log-email <email> - send logfiles to an email after rotation
Example: The following command enables log rotation; sets Log rotation condition to 5 MB, Maximum number of log files to 3 days; enables log compression and will send an email with logfiles to [email protected]:
# plesk bin site --update example.com -log-rotate true -log-bysize 5M -log-max-num-files 3 -log-compress true -log-email [email protected]