Log Rotation

Parallels Plesk Panel rotates logs using the logrotate utility. This is located in the $PRODUCT_ROOT_D/logrotate/sbin/logrotate directory, where the $PRODUCT_ROOT_D is /usr/local/psa for RPM-based systems or /opt/psa on DEB-based systems.

You can set the following parameters of logs rotation:

You can define log rotation parameters for Panel services in general and for each domain separately.

Log rotation parameters for Panel services are defined in the $PRODUCT_ROOT_D/etc/logrotate.conf configuration file. Part of this file is shown below.

# less /usr/local/psa/etc/logrotate.conf

include /usr/local/psa/etc/logrotate.d

/usr/local/psa/var/log/xferlog.processed {

missingok

rotate 3

size 10M

compress

nocreate

}

In turn, log rotation parameters for domains hosted on the Panel server are stored in configuration files in the $PRODUCT_ROOT_D/etc/logrotate.d/ directory.

You can configure log rotation for a particular domain through the Panel GUI. To do this:

  1. Log in to Control Panel.
  2. Open the Website & Domains tab, click Logs. If you do not see the Logs link, click Show Advanced Operations.
  3. Click Log Rotation.
  4. Change the log rotation configuration if needed.

When you click OK, the configuration is saved in the domain logrotate configuration file $PRODUCT_ROOT_D/etc/logrotate.d/<domain_name>. A fragment of this is provided below. Configuration changes are applied equally for all log files of this domain.

/var/www/vhosts/domain.tst/statistics/logs/*.processed {

monthly

rotate 10

compress

missingok

}

Please send us your feedback on this help page.