logrotate question

John Almberg jalmberg at identry.com
Wed Aug 20 15:30:36 UTC 2008

On Aug 20, 2008, at 8:48 AM, Rudi Kramer - MWEB wrote:

>> Zbigniew Szalbot
>> Sent: Wednesday, August 20, 2008 2:14 PM
>> To: User Questions
>> Subject: logrotate question
>> Dear all,
>> I am trying to use logrotate from ports and I am getting the  
>> following
>> error. Can anyone offer any insight?
> Hi Zbigniew,
> I started investigating logrotate but someone put me on to newsyslog
> instead.
> Newsyslog is part of the FreeBSD and amazing simple to setup:
> 1) vi /etc/newsyslog.conf
> 2) Add the following line:
> /var/log/httpd/*.log www:www         644  60    *   @T00    BJG
> /var/run/httpd.pid
> I would recommend reading man pages newsyslog newsyslog.conf for more
> info.

I use newsyslog for other log files, but when I decided I needed to  
rotate apache logs, recently (see "rotatelogs rotates logs too  
quickly" thread), I read the following in "Absolute FreeBSD, 2nd  

"If you simply use newsyslog to rotate your [Apache] logs as you do  
for other programs, Apache will corrupt its own logs. Apache supports  
logging to programs, however. I recommend handling your logs via  
rotatelogs(8), included with Apache."

It took me a whole day to switch over to rotatelogs and then  
investigate some odd behavior, but its working great now.

-- John

More information about the freebsd-questions mailing list