Question
According to KB article #114349, log rotation customization for system log files in not supported on NG hosting.
Does it mean that POA does not support customizing it from CP or it cannot be customized even manually in configuration files?
- What are the log rotation settings?
- Where are they stored exactly?
- Where are all the log files?
- Is it possible to change the log rotation settings by directly editing config files?
Answer
Log rotation works on NG cluster in the following way:
There must be periodic task on director web server that will start logparser:
~# grep -r logpars /etc/cron* /etc/crontab:0 2-23/3 * * * root /usr/local/pem/etc/web_cluster/isdirector.sh && /usr/local/pem/bin/logparser.sh >/dev/null 2>&1
Logparser
will rename log files in webspaces fromLOGFILENAME
toLOGFILENAME.processed
(i.e.access.log
is renamed toaccess.log.processed
)Logrotate
is run bycron
and it archives and rotates log files with .processed suffix:~# cat /etc/cron.daily/logrotate #!/bin/sh /usr/sbin/logrotate /etc/logrotate.conf EXITVALUE=$? if [ $EXITVALUE != 0 ]; then /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]" fi exit 0 ~# cat /etc/logrotate.d/pem # DEFAULT PARAMS BEGIN (DO NOT DELETE THIS LINE) missingok rotate 9 nomail daily compress # DEFAULT PARAMS END (DO NOT DELETE THIS LINE) /var/log/h2e-ftp/errors { } /var/log/h2e-ftp/tls.log { } /var/log/h2e-shstg.log { } /var/log/h2e-nss.log { } /var/log/httpd_error_log.processed { } /var/log/httpd_access_log.processed { } /var/log/httpd_error_log.ssl.processed { } /var/log/httpd_access_log.ssl.processed { } /var/www/vhosts/1/100386/log/*.processed { } /var/www/vhosts/1/100483/log/*.processed { } ...
It is possible to modify the log rotation settings by directly editing the above configuration files. Such changes are not officially supported and can be overwritten by POA Updates (although the possibility is low), but they should work fine.