You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andrew Hole <an...@gmail.com> on 2007/08/22 10:58:13 UTC

Delete Tomcat logs

Do you know some Windows script to delete Tomcat logs after 5 days?

Thanks a lot

Re: Delete Tomcat logs

Posted by Vivek Mohan <vi...@gmail.com>.
well, it was the maxbackupindex that was what I was trying to find
out. We already are in the process of deleting the files which are
older than a certain time period...

thanks,
Vivek.

On 8/22/07, Christopher Schultz <ch...@christopherschultz.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Vivek,
>
> Vivek Mohan wrote:
> > Is there a way to delete tomcat logs which are "older" than 5 days?
>
> You could configure Tomcat to use log4j instead of juli and use a
> DailyRollingFileAppender -- it will generate a new file every day and
> you can simply delete the ones that are several days behind whenever you
> want.
>
> (Unfortunately, DailyRollingFileAppender doesn't inherit from
> RollingFileAppender which includes a "max backup index" setting and will
> automatically clean up after old log files).
>
> - -chris
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGzIF19CaO5/Lv0PARAg39AKDCPdqZuNlmqfsZDvVhbwDacsnU1ACdEY82
> frNhYK+LhiH/3tkH1zAQZwE=
> =DVAL
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
"This is your life and it's ending one minute at a time."

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


Re: Delete Tomcat logs

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vivek,

Vivek Mohan wrote:
> Is there a way to delete tomcat logs which are "older" than 5 days?

You could configure Tomcat to use log4j instead of juli and use a
DailyRollingFileAppender -- it will generate a new file every day and
you can simply delete the ones that are several days behind whenever you
want.

(Unfortunately, DailyRollingFileAppender doesn't inherit from
RollingFileAppender which includes a "max backup index" setting and will
automatically clean up after old log files).

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGzIF19CaO5/Lv0PARAg39AKDCPdqZuNlmqfsZDvVhbwDacsnU1ACdEY82
frNhYK+LhiH/3tkH1zAQZwE=
=DVAL
-----END PGP SIGNATURE-----

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


Re: Delete Tomcat logs

Posted by Vivek Mohan <vi...@gmail.com>.
Is there a way to delete tomcat logs which are "older" than 5 days?

On 8/22/07, Peter Stavrinides <p....@albourne.com> wrote:
> You might want to truncate, 'not delete', instead.
>
> David Smith wrote:
> > AFAIK, this won't work on Windows unless you stop tomcat before and
> > restart tomcat after.  Windows keeps the log file open and will do
> > strange things if you take the file out from underneath it.  I believe
> > log4j has options to support what the OP wants through log rotation.
> >
> > --David
> >
> > Ronald Klop wrote:
> >
> >> On Wed Aug 22 10:58:13 CEST 2007 Tomcat Users List
> >> <us...@tomcat.apache.org> wrote:
> >>
> >>> Do you know some Windows script to delete Tomcat logs after 5 days?
> >>>
> >>> Thanks a lot
> >>
> >> Windows has a scheduler. Put 'DEL c:\Tomcat\logs\*.*' in it every 5
> >> days.
> >>
> >> Ronald.
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
"This is your life and it's ending one minute at a time."

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


Re: Delete Tomcat logs

Posted by Peter Stavrinides <p....@albourne.com>.
You might want to truncate, 'not delete', instead.

David Smith wrote:
> AFAIK, this won't work on Windows unless you stop tomcat before and 
> restart tomcat after.  Windows keeps the log file open and will do 
> strange things if you take the file out from underneath it.  I believe 
> log4j has options to support what the OP wants through log rotation.
>
> --David
>
> Ronald Klop wrote:
>
>> On Wed Aug 22 10:58:13 CEST 2007 Tomcat Users List 
>> <us...@tomcat.apache.org> wrote:
>>
>>> Do you know some Windows script to delete Tomcat logs after 5 days?
>>>
>>> Thanks a lot
>>
>> Windows has a scheduler. Put 'DEL c:\Tomcat\logs\*.*' in it every 5 
>> days.
>>
>> Ronald.
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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


Re: Delete Tomcat logs

Posted by David Smith <dn...@cornell.edu>.
AFAIK, this won't work on Windows unless you stop tomcat before and 
restart tomcat after.  Windows keeps the log file open and will do 
strange things if you take the file out from underneath it.  I believe 
log4j has options to support what the OP wants through log rotation.

--David

Ronald Klop wrote:

> On Wed Aug 22 10:58:13 CEST 2007 Tomcat Users List 
> <us...@tomcat.apache.org> wrote:
>
>> Do you know some Windows script to delete Tomcat logs after 5 days?
>>
>> Thanks a lot
>
> Windows has a scheduler. Put 'DEL c:\Tomcat\logs\*.*' in it every 5 days.
>
> Ronald.
>


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


Re: Delete Tomcat logs

Posted by Ronald Klop <ro...@base.nl>.
On Wed Aug 22 10:58:13 CEST 2007 Tomcat Users List <us...@tomcat.apache.org> wrote:
> Do you know some Windows script to delete Tomcat logs after 5 days?
> 
> Thanks a lot
Windows has a scheduler. Put 'DEL c:\Tomcat\logs\*.*' in it every 5 days.

Ronald.