While working on another task that took me to my /var/log directory, I happened to notice a file named http-mywebsitename.com-access.log that was 50Gb in size. Not exactly knowing what it was I found a file growing to such a size to be a little alarming, so I looked inside the file. It just seemed to be a record of every files' access.

While that could be useful I suppose, I couldn't think of any present use for a 50Gb record, so I emptied the file to free the space and went on with my business. Five days later, it is 60Mb again. So here are my questions:

  1. Where does one turn this log on and off?
  2. What controls the level of granularity saved in this log?
  3. Why would I want to keep a multi-Gb access log around?
link|improve this question
feedback

migrated from stackoverflow.com Jul 25 '11 at 20:14

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 2 down vote accepted

You need to use log rotate

http://httpd.apache.org/docs/2.0/programs/rotatelogs.html

It will automatically eliminate old logs

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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