• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Log Rotate Doesn't Rotate

Ed_Greenberg

New Pleskian
I have a Plesk 12 installation that is not rotating logs.

What I've done
* Turned on Log rotation for the proper domain. I set it to rotate daily, so there was no issue regarding file size.

* Checked for a correct file in /usr/local/psa/etc/logrotate.d

* Ran /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php as root from the command line.

Any further suggestions?

Thanks,

Ed Greenberg
 
Hello Ed,

Welcome to the forums. Another possible diagnostic step you can take is to run the logrotate utility manually for a single domain. I would recommend setting the log rotation condition to "By size", as it is less ambiguous than "By time". Set the threshold really low (say, 4 KB), generate some hits to ensure that the access_log file exceeds the value you set, then run the following commands:

/usr/local/psa/admin/sbin/statistics --calculate-one --domain-name=<your_domain_name_here>

See if it does the trick. The expected result is that a) the contents of the access_log would be merged into the access_log.processed file and b) the access_log.processed file would be rotated as per the log rotation settings. If the former happens, but not the latter, try the following command:

/usr/local/psa/logrotate/sbin/logrotate /usr/local/psa/etc/logrotate.d/<your_domain_name_here>

This one is supposed to rotate the access_log.processed file. If it does not despite the file meeting the log rotation criterion (as set in /usr/local/psa/etc/logrotate.d/<your_domain_name_here>), most likely something is up with the logrotate utility. Check that the permissions on the log files are correct (root:root, 644 for all files except the *.webstat ones), maybe reinstall the psa-logrotate, the usual stuff.

Anyway, these steps should help you narrow the problem down and hopefully find a solution. Once you've figured it out, it would be mighty kind of you to share the root cause and the fix so that other users may benefit from your wisdom )
 
Back
Top