News:

SMF - Just Installed!

Main Menu

Logs are not being rotated for a domain in Plesk

Started by Suhitha, Nov 07, 2025, 07:21 AM

Previous topic - Next topic

Suhitha

Question: Logs are not being rotated for a domain in Plesk


Applicable to:

Plesk for Linux


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-28
  • The 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.status

error: 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

1.Connect to the server via SSH

2.Move /usr/local/psa/var/logrotate.status file:

# mv /usr/local/psa/var/logrotate.status /usr/local/psa/var/logrotate.status_old

3.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.


4.Check if the logrotate.status file 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-28

When extra domains are added to the subscription, configure them by following the article How to configure log rotation for domain?