apacheログのlogrotate設定

apacheのaccess_logなどが肥大化する一方なので、logrotateを使って区切るように設定。(したつもり)
/etc/logrotate.d/配下にapachelogを下記の内容で作成

/var/log/apache/access_log /var/log/apache/error_log /var/log/apache/ssl_engine_log /var/log/apache/ssl_request_log {
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /usr/local/apache1.3.31/logs/httpd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

debugしてみるが特にerrorはない

[root@asia apache]# logrotate -dv /etc/logrotate.d/apachelog
reading config file /etc/logrotate.d/apachelog
reading config info for /var/log/apache/access_log /var/log/apache/error_log /var/log/apache/ssl_engine_log /var/log/apache/ssl_request_log
Handling 1 logs
rotating pattern: /var/log/apache/access_log /var/log/apache/error_log /var/log/apache/ssl_engine_log /var/log/apache/ssl_request_log  1048576 bytes (no old logs will be kept)
empty log files are rotated old logs are removed
rotating file /var/log/apache/access_log
log does not need rotating
rotating file /var/log/apache/error_log
log does not need rotating
rotating file /var/log/apache/ssl_engine_log
log does not need rotating
rotating file /var/log/apache/ssl_request_log
log does not need rotating
running shared postrotate script
running script with arg /var/log/apache/access_log /var/log/apache/error_log /var/log/apache/ssl_engine_log /var/log/apache/ssl_request_log : "
        /bin/kill -HUP `cat /usr/local/apache1.3.31/logs/httpd.pid 2> /dev/null` 2> /dev/null || true
"

しばらく様子を見ることに。

タイトルとURLをコピーしました