• The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Create daily access logs

HielkeJ

New Pleskian
Hello,

I want to save the access logs of our websites on an external server. If I do this now with the default setup, the gets overwritten every day. The desired file name format whould be: websitedomain-tld-access-2014-10-24.log

How can I tell Plesk to do this and how can I make sure the statistics keep working?

On our other servers we use rotatelogs for this.

Thanks!
 
You might edit the domain-specific logrotate - definitions, located at "/usr/local/psa/etc/logrotate.d" . An example, based on your specifications would be:

Code:
/var/www/vhosts/system/YOUR-SPECIFIC-DOMAIN.COM/logs/access_log {
    daily
    missingok
    rotate 30
    notifempty
    dateext
    nocompress
    nomail
    dateformat _YOUR-SPECIFIC-DOMAIN.COM-%Y-%m-%d.log
}
/var/www/vhosts/system/YOUR-SPECIFIC-DOMAIN.COM/logs/proxy_access_log {
    daily
    missingok
    rotate 30
    notifempty
    dateext
    nocompress
    nomail
    dateformat _YOUR-SPECIFIC-DOMAIN.COM-%Y-%m-%d.log
}
As you can see, the definition would add a date-extension to the rotated log, so the rotated logs would look this way: access-log_YOUR-SPECIFIC-DOMAIN.COM-2014-10-24.log or proxy_access-log_YOUR-SPECIFIC-DOMAIN.COM-2014-10-24.log.


Be aware, that the files in "/usr/local/psa/etc/logrotate.d" might get overritten by Plesk in case of updates/upgrades/patches, or if you change settings for a subscription plan or for domain. This mentioned on the top of all files.
 
Thank you for this solution. Is there an option to make sure that the lines are added after a change / update?

If that is not possible, I will create a script and start that with the event handler.
 
Sure, HielkeJ,

just make an exact copy of the log - rotation file and name it to your desired name ( i.e.: "apache2" to "zzz_apache2" ... in your case maybe: DOMAIN_NAME.apache2 ). When you rename these files they are still executed, so you might want to delete doubles with different names, so your logrotation doesn't do the same job twice, when rotating the logs.
 
Back
Top