Rotating apache logs

Eric Shubert ejs at shubes.net
Fri Jun 25 16:30:15 MST 2010


Jason Holtzapple wrote:
> On 06/25/2010 04:03 PM, Eric Shubert wrote:
>> It appears that there are 2 ways of rotating apache logs.
>>
>> Logrotate can be used, in which case apache needs to be restarted after
>> the logs are rotated.
> 
> Yes, but this is usually a graceful restart, at least.
> 
>> There is also a rotatelogs program included with apache that controls
>> log rotation (http://httpd.apache.org/docs/2.2/programs/rotatelogs.html).
>>
>> Does anyone have a preference, or know which is considered to be best
>> practice? I'm inclined to lean toward the later.
> 
> I've always used the system log rotator (logrotate, logadm, etc). If
> you're concerned about the effects of a restart you could try
> logrotate's copytruncate option.
> 
> 

I see now that the stock logwatch is doing a reload for apache. I 
suppose that's not so bad. I have several vhosts, but they can be all 
covered with a single logwatch entry, so a single reload isn't so bad I 
suppose. A lot less config coding than using the rotatelogs program.

Thanks.

-- 
-Eric 'shubes'



More information about the PLUG-discuss mailing list