Apache Log Rotation


Tags:

in httpd.conf, add:

CustomLog "|/u01/app/apache/bin/rotatelogs /u01/app/apache/logs/access_log.%Y%m%d 86400 -360" common

(changing the path as needed...)
where the number 86400 is seconds to rotation (86400 is 24 hours)
and -360 is minutes offset from UTC 0 (-360 is for US Central)

and comment out any other line beginning with 'CustomLog'

this will give you logs, rotated daily, named something like:

access_log.20061101
access_log.20061102
access_log.20061103

...so you don't have to stop the server to deal with gigantic log files...