Plesk

Logs are not being rotated for a domain in Plesk

Symptoms

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?