Apache access log rotation

apache-2.2log-fileslogrotate

I think my system is using logrotate for rotating logs including httpd logs

The "current" files is logged here /var/log/httpd/ but I only see the last 5 days(I think)

But how can I find where previous log file exists. I thought they was created at the same place as the current.

I have been looking around in logrotate but is not getting any wiser, anyone here who could help me?

Thanks in advance,

bob

Best Answer

You probably have something looking like this in your logrotate configuration file

"/var/log/httpd/access.log" /var/log/httpd/error.log {
           rotate 5
           size=100k
           sharedscripts
           postrotate
                                     /sbin/killall -HUP httpd
           endscript
       }

rotate 5 means that only last 5 files will be keept. Here file are turned every 100k.
if you have the daily keyword it means that each archived file is 1 day of log. If you want to keep file longer on the server you have to increase the rotate value