newsyslog.conf and Apache log files

Lowell Gilbert freebsd-questions-local at be-well.ilk.org
Thu Oct 7 20:56:34 UTC 2010


Robert Huff <roberthuff at rcn.com> writes:

> Joe Auty writes:
>
>>  I have the following entry for dealing with my Apache log files:
>>  
>>  /var/log/httpd/*             644  2     *  $M1D0 GBJ   
>>  /var/run/httpd.pid 30
>>  
>>  Unfortunately, this has created these big long log files such as the
>>  following:
>>  
>>  httpderror_log.2.bz2.2.bz2.2.bz2.1.bz2.1.bz2.1.bz2.0.bz2
>>  
>>  How can I prevent these dumb log file names from being created?
>
> 	My advice would be to not use syslog.  It's bee a while since I
> fixed this problen, but I remember reading Apache has ... issues
> ... with rotating logs using syslog/newsyslog.  

Those problems were a race condition between (Apache) closing the log
file and (newsyslog) opening it to start compression.  *How* the log
rotation is done isn't really relevant (unless one sends the logs
through pipes), but the only safe way is to shut down the server while
the rotation is being done.  

You don't compress your logs, so it wouldn't affect you anyway.  Joe
does, so it could be an issue for him; the Apache documentation covers a
number of options.  


More information about the freebsd-questions mailing list