tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Mikusa <dmik...@vmware.com>
Subject Re: Limit log files rotation
Date Tue, 05 Mar 2013 18:06:36 GMT
On Mar 5, 2013, at 12:40 PM, Felipe Jaekel wrote:

> Thanks for the link.
> 
> Searching a bit more I found this:
> http://www.queuemetrics.com/manuals/QM_AdvancedConfig-chunked/ar01s17.html

Watch out when using "logrotate" with the "copytruncate" option, in some circumstances this
can result in data loss.

> 
> Simple to setup, but anyway it would be nice if Tomcat could do this out of
> the box, since the server can crash if it runs out of disk space.

Tomcat offers several ways to handle logging out-of-the-box, including the one you mentioned.
 I believe it's documented here.

  https://wiki.apache.org/tomcat/FAQ/Logging

Dan


> 
> 
> 2013/3/5 Daniel Mikusa <dmikusa@vmware.com>
> 
>> On Mar 5, 2013, at 8:54 AM, Felipe Jaekel wrote:
>> 
>>> Hi,
>>> 
>>> I'd like to limit log rotation to a specific number of days to avoid that
>>> the logs folder keep growing indeterminately.
>> 
>> Which log files are you referring to?  Including the names would help.
>> 
>>> 
>>> Tried to google about, people say to study Log4j or use crontab,
>>> but isn't there an easier way like a *maxHistory* property?
>> 
>> Tomcat's default logging mechanism will simply rotate files.  It does not
>> perform any cleanup or archival.
>> 
>> If you want those features, you have two choices …
>> 
>> 1.) Setup a cron job to cleanup or archive old log files.
>> 2.) Use Tomcat's log4j support.  Log4j supports cleanup and archival.
>> 
>>  https://tomcat.apache.org/tomcat-7.0-doc/logging.html#Using_Log4j
>> 
>> There's probably other things you can do as well.  Those are just the
>> first two that popped into my head.
>> 
>> Dan
>> 
>>> 
>>> Thanks,
>>> Phillip
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message