I have my own server instance which is centos 5.7 and have installed apache some time ago. Now I noticed that my log files are rotating. I couldn't remember if I had set up something or not since there is nothing on cron, and the error logging on apache isn't piped.

Here's how error logging defined on one of the virtual hosts:

ErrorLog /etc/httpd/logs/domain.com-access_log

But when I go to the logs dir, I see the log files rotated in this manner:

/etc/httpd/logs/domain.com/access_log
/etc/httpd/logs/domain.com/access_log.1.gz
/etc/httpd/logs/domain.com/access_log.2.gz
/etc/httpd/logs/domain.com/access_log.3.gz
/etc/httpd/logs/domain.com/access_log.4.gz

I also noted that all the virtual hosts had the same number of rotated logs (4), and creates one every 7 days, and that the #4 log is always 3 weeks in the past. Also, these log files rotate in this manner no matter how big or small the log file is.

So my question is, do you have any idea what kind of rotator this is? I just want to put it back to writing to a lone access_log file. Thanks.

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

It's the standard linux logrotate system that is doing this.

Files of interest will be: /etc/logrotate.conf, /etc/logrotate.d/httpd, and also /etc/cron.daily/logrotate.

link|improve this answer
cool thanks, im kinda confused with size/minsize + the weekly option. which between size and minsize should i use if i want to skip the weekly log rotation if it hasn't reached 10MB yet? – voldomazta Dec 21 '11 at 3:01
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.