Symptoms
Logs are not being rotated for one or several domains.
The date the logs of the domain example.com have been rotated last time is long ago:
# grep example.com /usr/local/psa/var/logrotate.status
"/var/www/vhosts/system/example.com/logs/error_log" 2019-8-28
"/var/www/vhosts/system/example.com/logs/access_log.processed" 2019-8-28
"/var/www/vhosts/system/example.com/logs/access_ssl_log.processed" 2019-8-28
"/var/www/vhosts/system/example.com/logs/proxy_error_log" 2019-8-28The following error might be found in
/var/log/plesk/panel.log:Log rotation '/usr/local/psa/logrotate/sbin/logrotate /usr/local/psa/etc/logrotate.conf -s /usr/local/psa/var/logrotate.status' failed with code 1.
Stdout:
Stderr:error: line 4332 too long in state file /usr/local/psa/var/logrotate.statuserror: could not read state file, will not attempt to write into it
Cause
The /usr/local/psa/var/logrotate.status file got corrupted.
This file is where logrotate stores information about when each log file has been last rotated.
Resolution
Connect to the server via SSH
Move
/usr/local/psa/var/logrotate.statusfile:# mv /usr/local/psa/var/logrotate.status /usr/local/psa/var/logrotate.status_old
Run daily maintenance task is charge of statistics calculation and log rotation:
# plesk daily ExecuteStatistics
Note: depending of the number of domains hosted, this operation might take some time, thus consider waiting for the next automatic execution of daily tasks.
Check if the
logrotate.statusfile is successfully regenerated:# grep example.com /usr/local/psa/var/logrotate.status
"/var/www/vhosts/system/example.com/logs/error_log" 2020-8-28
"/var/www/vhosts/system/example.com/logs/access_log.processed" 2020-8-28
"/var/www/vhosts/system/example.com/logs/access_ssl_log.processed" 2020-8-28
"/var/www/vhosts/system/example.com/logs/proxy_error_log" 2020-8-28When extra domains are added to the subscription, configure them by following the article How to configure log rotation for domain?