• 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

Issue Subdomain logs are not rotated

wilei

New Pleskian
Hi,

I'm running Plesk 12.5.30 (Update 40) on CentOS 7.2.1511, with latest updates installed for both Plesk and OS.

I found out that Plesk is missing correct log rotation rules for subdomain HTTP access logs (both logs from Apache and Nginx). I did some digging and there is no any configurations for subdomain log rotation in /usr/local/psa/etc/logrotate.d.

Let's say that domain I'm hosting with Plesk is domain.tld and subdomain under this domain is subdomain.domain.tld. Subdomain is used just to deliver huge amount of images, PHP etc. features are turned off for this subdomain, so it's only for static data. SSL for all connections.

Logs for domain.tld are found from path:
/var/www/vhosts/system/domain.tld/logs/

And for subdomain subdomain.domain.tld from path:
/var/www/vhosts/system/subdomain.domain.tld/logs/

There is log rotate configuration for domain.tld in file /usr/local/psa/etc/logrotate.d/domain.tld. But there is no rules for subdomain log rotation. There is this rotation group in configs: /var/www/vhosts/system/domain.tld/logs/*.processed but no group for subdomain logs.

This has led to situation where log /var/www/vhosts/system/subdomain.domain.tld/logs/access_ssl_log.processed has grown to pretty huge. 14 gigabytes and counting as there is no rotation for file.


How this can be fixed? And editing /usr/local/psa/etc/logrotate.d/domain.tld is out-of-scope as it's auto-generated by Plesk. Also all custom rotation configs are out-of-scope as these configs must be also auto-generated as domain log rotate configs are.
 
Yes, it is known issue. I have updated already existing report OMO-192 with your case.
 
Also, you can try to use the following workaround:

# plesk bin domain --update sub.domain.com -log-rotate true
 
Tried that provided workaround:

# plesk bin domain --update sub.domain.com -log-rotate true

And it created configuration for the log rotation. But the contents of the file is "wrong".

For the domain log rotation rules are:
/var/www/vhosts/system/domain.tld/logs/*.processed {
weekly
rotate 104
compress
missingok
}

but newly created rotation rules for subdomain.domain.tld are:
/var/www/vhosts/system/subdomain.domain.tld/logs/*.processed {
size=5242880
rotate 0
compress
missingok
}

Funny enough, I found out that logs for the another subdomain (under the same domain) but which is created way back earlier that the one with problems, has working log file rotation. For it log files are rotated once in a week. And rules for that domain are correct:

/var/www/vhosts/system/sub2.domain.tld/logs/*.processed {
weekly
compress
missingok
rotate 104
}
 
As far as I know this bug will be completely fixed in Plesk Onyx.
 
Back
Top