Log rotation replaces growing website logs with new files and retains a chosen number of older copies. In Plesk, you can configure this per domain to manage disk usage while keeping the history you need for troubleshooting.
Configure rotation in Plesk
- Log in to Plesk with permission to manage the domain’s logs.
- Open the domain under Websites & Domains or Domains.
- Click Logs, then Log Rotation.
- Enable Log rotation.
- Choose a time-based or size-based rotation condition.
- Set a positive number of log files to retain, according to your retention requirements.
- Enable compression if appropriate.
- Configure email delivery only if you need it and the destination is authorised to receive the log contents.
- Click OK.
Existing permissions and the installed Plesk version determine which options are shown. Do not use a zero retention value as a general cleanup shortcut.
Configure a Linux server from the command line
A Plesk administrator on Linux can use the site utility. The following example enables size-based rotation at 5 MB, keeps three log files and enables compression:
plesk bin site --update example.com -log-rotate true -log-bysize 5M -log-max-num-files 3 -log-compress trueReplace the domain and values with your requirements. This is a Linux example; do not copy shell line continuation syntax into a Windows command prompt.
To disable email delivery of rotated logs:
plesk bin site --update example.com -log-email ""Verify retention
Reopen the domain’s settings and confirm the saved values. Check later rotation runs and disk usage. Disabling rotation allows logs to continue growing unless another configured process manages them.