Forum Moderators: phranque

Message Too Old, No Replies

Apache Access/Error logs

Recycling logs

         

madanmohan

10:36 am on Nov 18, 2007 (gmt 0)

10+ Year Member




How to limit number of retained (access/error) logs to specific number?

phranque

1:55 pm on Nov 18, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld [webmasterworld.com], madanmohan!

you could use a cron job to rename your current and archived log files by generation, replacing the oldest generation each time.
for example, if you wanted to archive 4 generations, your script might look like:

apachectl stop
mv /path/to/access_log.3 /path/to/access_log.4
mv /path/to/access_log.2 /path/to/access_log.3
mv /path/to/access_log.1 /path/to/access_log.2
mv /path/to/access_log /path/to/access_log.1
apachectl start

madanmohan

2:14 pm on Nov 18, 2007 (gmt 0)

10+ Year Member




Thanx phranque.

Actually I am using apache in windows environment version 2.0.54.
Are tere any changes in httpd.conf file for limiting size of access log and limit no of log files.