View Single Post
Old 10-16-2003, 11:54 AM  
vending_machine
Confirmed User
 
Join Date: Jun 2002
Location: Seattle
Posts: 1,062
Quote:
Originally posted by fletcher
Use "logrotate" to do it. You have to send Apache an HUP signal after you remove it to make it create a new logfile.
Or...

To save your logs in a compressed format:
Code:
gzip -c logfile > logfile.gz && cat /dev/null > logfile

the above code for Linux I believe is:
gzip -c logfile > logfile.gz && echo -n "" > logfile
The thing is that if you remove or rename your logfile, Apache will no longer be able to write log information as it has lost the pointer to the file. The way to get around it is to zero it out as in the example above.. That way you wont have to restart the webserver.
vending_machine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote