Article ID: 118036, created on Oct 18, 2013, last review on Oct 18, 2013

  • Applies to:
  • Operations Automation 5.4

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?

  1. What are the log rotation settings?
  2. Where are they stored exactly?
  3. Where are all the log files?
  4. 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:

  1. 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
    
  2. Logparser will rename log files in webspaces from LOGFILENAME to LOGFILENAME.processed (i.e. access.log is renamed to access.log.processed)

  3. Logrotate is run by cron 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.

Search Words

Log rotation

NG

ac82ce33439a9c1feec4ff4f2f638899 caea8340e2d186a540518d08602aa065 5356b422f65bdad1c3e9edca5d74a1ae 2554725ed606193dd9bbce21365bed4e e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF