You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Shapira, Yoav" <Yo...@mpi.com> on 2003/06/10 20:01:38 UTC

FW: Rotating catalina.out.

Howdy,
I just posted this to the tomcat-user mailing list.  Over there, several
users now and in the past have asked for the catalina.out (tomcat's
default System.out / System.err destination) file to be rotated on a
regular basis.  One person suggested using Apache's rotatelogs
(http://httpd.apache.org/docs-2.0/programs/rotatelogs.html) program to
accomplish this.

Tomcat already uses an internal mechanism to rollover other log files.
Log4j obviously has its own mechanism.

Now that we have a brand new rollover implementation in the works for
log4j 1.3, I was wondering if it makes sense to make a jakarta-commons
subproject out of it.  See the message below for more details.

What do people think?

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Shapira, Yoav
>Sent: Tuesday, June 10, 2003 1:57 PM
>To: Tomcat Users List
>Subject: RE: Rotating catalina.out.
>
>
>Howdy,
>I will throw out one other thing, partially for myself so that when I
>look through this thread in the archives I remember this:
>
>Over in log4j land, we've got a new, flexible, generic, powerful file
>rollover mechanism.  It has the normal features (rollover based on file
>size, on date [including hourly, every X minutes, etc.]) and some
cooler
>ones (compress when rolling over, rename when rolling over, etc.).
Both
>the rolling trigger and action are easily extensible.
>
>These rollover framework will be used in log4j 1.3, the next major
>version.  I wonder if it can be made slightly more generic and into a
>jarkarta-commons-sandbox project.  That will require discussion and
>consent from the log4j developers to start with.  But if it's a commons
>project, tomcat could use it instead of something from unix land.
>
>Yoav Shapira
>Millennium ChemInformatics
>
>
>>-----Original Message-----
>>From: PELOQUIN,JEFFREY (HP-Boise,ex1) [mailto:jeffrey.peloquin@hp.com]
>>Sent: Tuesday, June 10, 2003 1:47 PM
>>To: 'Tomcat Users List'
>>Subject: RE: Rotating catalina.out.
>>
>>Will do.  I have to do a new test server install over the next week
>anyway,
>>so I will work through the various permutations and post the results.
>>
>>Jeff
>>
>>-----Original Message-----
>>From: Shapira, Yoav [mailto:Yoav.Shapira@mpi.com]
>>Sent: Tuesday, June 10, 2003 11:40 AM
>>To: Tomcat Users List
>>Subject: RE: Rotating catalina.out.
>>
>>
>>
>>Howdy,
>>Can you submit your proposed modification to the script, and what it
>>would require (e.g. downloading rotatelogs and placing it somewhere)?
>I
>>think catalina.out rotation is a generically useful enough feature to
>>make its way into the tomcat distribution eventually...
>>
>>Yoav Shapira
>>Millennium ChemInformatics
>>
>>
>>>-----Original Message-----
>>>From: PELOQUIN,JEFFREY (HP-Boise,ex1)
[mailto:jeffrey.peloquin@hp.com]
>>>Sent: Tuesday, June 10, 2003 1:28 PM
>>>To: 'Tomcat Users List'
>>>Subject: RE: Rotating catalina.out.
>>>
>>>Something I have always wanted to try was to modify
>>>
>>>this line of the catalina.sh
>>>
>>>$JAVA_HOME/bin/java $CATALINA_OPTS -classpath $CP \
>>>     -Djava.security.manager \
>>>     -Djava.security.policy==$CATALINA_BASE/conf/catalina.policy \
>>>     -Dcatalina.base=$CATALINA_BASE \
>>>     -Dcatalina.home=$CATALINA_HOME \
>>>     org.apache.catalina.startup.Bootstrap "$@" start \
>>>     >> $CATALINA_BASE/logs/catalina.out
>>>
>>>to use the rotatelogs progran from apache, see for example
>>>http://httpd.apache.org/docs-2.0/logs.html#piped
>>>
>>>or simply catalina.sh do the rotation here using mv
>>>of course you have to remeber to update the script when you install a
>>new
>>>tomcat
>>>
>>>
>>>-----Original Message-----
>>>From: Tim Funk [mailto:funkman@joedog.org]
>>>Sent: Tuesday, June 10, 2003 11:00 AM
>>>To: Tomcat Users List
>>>Subject: Re: Rotating catalina.out.
>>>
>>>
>>>In windows - your screwed.
>>>
>>>In unix: (YMMV)
>>>cp -f catalina.out catalina.out-old
>>>cat /dev/null > catalina.out
>>>
>>>In a nutshell - wacky every developer upside the head which uses
>>>System.out,
>>>
>>>System.err. Then make them use a logging package such as log4j,
>>>commons-logging, ... And catalina.out becomes "unused"
>>>
>>>-Tim
>>>
>>>
>>>Eric J. Pinnell wrote:
>>>> Hi,
>>>>
>>>> Our catalina.out gets rather large.  We would like to keep the
data.
>>>Does
>>>> anybody have a good solution for rotating it w/o restarting the
>>>> application?  Or can that even be done?
>>>>
>>>> I was thinking of renaming the file and then touching catalina.out
>to
>>>> create a new file but I have some concerns that tomcat won't write
>to
>>the
>>>> file once it sees it move.
>>>>
>>>> Anybody have any thoughts?
>>>>
>>>> -e
>>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>>
>>
>>This e-mail, including any attachments, is a confidential business
>>communication, and may contain information that is confidential,
>>proprietary
>>and/or privileged.  This e-mail is intended only for the individual(s)
>to
>>whom it is addressed, and may not be saved, copied, printed, disclosed
>or
>>used by anyone else.  If you are not the(an) intended recipient,
please
>>immediately delete this e-mail from your computer system and notify
the
>>sender.  Thank you.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
>This e-mail, including any attachments, is a confidential business
>communication, and may contain information that is confidential,
>proprietary and/or privileged.  This e-mail is intended only for the
>individual(s) to whom it is addressed, and may not be saved, copied,
>printed, disclosed or used by anyone else.  If you are not the(an)
intended
>recipient, please immediately delete this e-mail from your computer
system
>and notify the sender.  Thank you.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged.  This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender.  Thank you.


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


Re: FW: Rotating catalina.out.

Posted by Jacob Kjome <ho...@visi.com>.
Hi Ceki,

At 09:59 PM 6/10/2003 +0200, you wrote:

>It seems to me that log rotation is too small a scope for any project.
>
>Moreover, I was under the impression that T5 was going to use log4j directly.

Where did you hear that?  Based on build of the recent CVS of Tomcat5, 
commons-logging seems to be the logging API used.  Log4j isn't even 
included in common/lib.  I don't see how it could be used directly if it 
doesn't exist at runtime?

Jake

>At 02:01 PM 6/10/2003 -0400, you wrote:
>
>>Howdy,
>>I just posted this to the tomcat-user mailing list.  Over there, several
>>users now and in the past have asked for the catalina.out (tomcat's
>>default System.out / System.err destination) file to be rotated on a
>>regular basis.  One person suggested using Apache's rotatelogs
>>(http://httpd.apache.org/docs-2.0/programs/rotatelogs.html) program to
>>accomplish this.
>>
>>Tomcat already uses an internal mechanism to rollover other log files.
>>Log4j obviously has its own mechanism.
>>
>>Now that we have a brand new rollover implementation in the works for
>>log4j 1.3, I was wondering if it makes sense to make a jakarta-commons
>>subproject out of it.  See the message below for more details.
>>
>>What do people think?
>>
>>Yoav Shapira
>>Millennium ChemInformatics
>>
>>
>> >-----Original Message-----
>> >From: Shapira, Yoav
>> >Sent: Tuesday, June 10, 2003 1:57 PM
>> >To: Tomcat Users List
>> >Subject: RE: Rotating catalina.out.
>> >
>> >
>> >Howdy,
>> >I will throw out one other thing, partially for myself so that when I
>> >look through this thread in the archives I remember this:
>> >
>> >Over in log4j land, we've got a new, flexible, generic, powerful file
>> >rollover mechanism.  It has the normal features (rollover based on file
>> >size, on date [including hourly, every X minutes, etc.]) and some
>>cooler
>> >ones (compress when rolling over, rename when rolling over, etc.).
>>Both
>> >the rolling trigger and action are easily extensible.
>> >
>> >These rollover framework will be used in log4j 1.3, the next major
>> >version.  I wonder if it can be made slightly more generic and into a
>> >jarkarta-commons-sandbox project.  That will require discussion and
>> >consent from the log4j developers to start with.  But if it's a commons
>> >project, tomcat could use it instead of something from unix land.
>> >
>> >Yoav Shapira
>> >Millennium ChemInformatics
>> >
>> >
>> >>-----Original Message-----
>> >>From: PELOQUIN,JEFFREY (HP-Boise,ex1) [mailto:jeffrey.peloquin@hp.com]
>> >>Sent: Tuesday, June 10, 2003 1:47 PM
>> >>To: 'Tomcat Users List'
>> >>Subject: RE: Rotating catalina.out.
>> >>
>> >>Will do.  I have to do a new test server install over the next week
>> >anyway,
>> >>so I will work through the various permutations and post the results.
>> >>
>> >>Jeff
>> >>
>> >>-----Original Message-----
>> >>From: Shapira, Yoav [mailto:Yoav.Shapira@mpi.com]
>> >>Sent: Tuesday, June 10, 2003 11:40 AM
>> >>To: Tomcat Users List
>> >>Subject: RE: Rotating catalina.out.
>> >>
>> >>
>> >>
>> >>Howdy,
>> >>Can you submit your proposed modification to the script, and what it
>> >>would require (e.g. downloading rotatelogs and placing it somewhere)?
>> >I
>> >>think catalina.out rotation is a generically useful enough feature to
>> >>make its way into the tomcat distribution eventually...
>> >>
>> >>Yoav Shapira
>> >>Millennium ChemInformatics
>> >>
>> >>
>> >>>-----Original Message-----
>> >>>From: PELOQUIN,JEFFREY (HP-Boise,ex1)
>>[mailto:jeffrey.peloquin@hp.com]
>> >>>Sent: Tuesday, June 10, 2003 1:28 PM
>> >>>To: 'Tomcat Users List'
>> >>>Subject: RE: Rotating catalina.out.
>> >>>
>> >>>Something I have always wanted to try was to modify
>> >>>
>> >>>this line of the catalina.sh
>> >>>
>> >>>$JAVA_HOME/bin/java $CATALINA_OPTS -classpath $CP \
>> >>>     -Djava.security.manager \
>> >>>     -Djava.security.policy==$CATALINA_BASE/conf/catalina.policy \
>> >>>     -Dcatalina.base=$CATALINA_BASE \
>> >>>     -Dcatalina.home=$CATALINA_HOME \
>> >>>     org.apache.catalina.startup.Bootstrap "$@" start \
>> >>>     >> $CATALINA_BASE/logs/catalina.out
>> >>>
>> >>>to use the rotatelogs progran from apache, see for example
>> >>>http://httpd.apache.org/docs-2.0/logs.html#piped
>> >>>
>> >>>or simply catalina.sh do the rotation here using mv
>> >>>of course you have to remeber to update the script when you install a
>> >>new
>> >>>tomcat
>> >>>
>> >>>
>> >>>-----Original Message-----
>> >>>From: Tim Funk [mailto:funkman@joedog.org]
>> >>>Sent: Tuesday, June 10, 2003 11:00 AM
>> >>>To: Tomcat Users List
>> >>>Subject: Re: Rotating catalina.out.
>> >>>
>> >>>
>> >>>In windows - your screwed.
>> >>>
>> >>>In unix: (YMMV)
>> >>>cp -f catalina.out catalina.out-old
>> >>>cat /dev/null > catalina.out
>> >>>
>> >>>In a nutshell - wacky every developer upside the head which uses
>> >>>System.out,
>> >>>
>> >>>System.err. Then make them use a logging package such as log4j,
>> >>>commons-logging, ... And catalina.out becomes "unused"
>> >>>
>> >>>-Tim
>> >>>
>> >>>
>> >>>Eric J. Pinnell wrote:
>> >>>> Hi,
>> >>>>
>> >>>> Our catalina.out gets rather large.  We would like to keep the
>>data.
>> >>>Does
>> >>>> anybody have a good solution for rotating it w/o restarting the
>> >>>> application?  Or can that even be done?
>> >>>>
>> >>>> I was thinking of renaming the file and then touching catalina.out
>> >to
>> >>>> create a new file but I have some concerns that tomcat won't write
>> >to
>> >>the
>> >>>> file once it sees it move.
>> >>>>
>> >>>> Anybody have any thoughts?
>> >>>>
>> >>>> -e
>> >>>>
>> >>>
>> >>>
>> >>>---------------------------------------------------------------------
>> >>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> >>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>> >>>
>> >>>---------------------------------------------------------------------
>> >>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> >>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>> >>
>> >>
>> >>
>> >>
>> >>This e-mail, including any attachments, is a confidential business
>> >>communication, and may contain information that is confidential,
>> >>proprietary
>> >>and/or privileged.  This e-mail is intended only for the individual(s)
>> >to
>> >>whom it is addressed, and may not be saved, copied, printed, disclosed
>> >or
>> >>used by anyone else.  If you are not the(an) intended recipient,
>>please
>> >>immediately delete this e-mail from your computer system and notify
>>the
>> >>sender.  Thank you.
>> >>
>> >>
>> >>---------------------------------------------------------------------
>> >>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> >>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>> >>
>> >>---------------------------------------------------------------------
>> >>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> >>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>> >
>> >
>> >
>> >
>> >This e-mail, including any attachments, is a confidential business
>> >communication, and may contain information that is confidential,
>> >proprietary and/or privileged.  This e-mail is intended only for the
>> >individual(s) to whom it is addressed, and may not be saved, copied,
>> >printed, disclosed or used by anyone else.  If you are not the(an)
>>intended
>> >recipient, please immediately delete this e-mail from your computer
>>system
>> >and notify the sender.  Thank you.
>> >
>> >
>> >---------------------------------------------------------------------
>> >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>>
>>
>>This e-mail, including any attachments, is a confidential business 
>>communication, and may contain information that is confidential, 
>>proprietary and/or privileged.  This e-mail is intended only for the 
>>individual(s) to whom it is addressed, and may not be saved, copied, 
>>printed, disclosed or used by anyone else.  If you are not the(an) 
>>intended recipient, please immediately delete this e-mail from your 
>>computer system and notify the sender.  Thank you.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: log4j-dev-help@jakarta.apache.org
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-dev-help@jakarta.apache.org