You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Goo Sam Kong <sk...@gmail.com> on 2010/04/21 10:07:08 UTC

Logging Requirement in Tomcat 5.5.16

Hi,

I am using Log4j logging in Tomcat 5.5.16 with JDK 1.5.0 update 7 on RedHat
Linux server.

I followed the instructions on
http://tomcat.apache.org/tomcat-5.5-doc/logging.html to copy the
commons-logging-1.0.4.jar and log4j.jar into $CATALINA_HOME/common/lib
directory.

and created log4j.properties in $CATALINA_HOME/common/classes directory as
below:

log4j.rootLogger=info, CATALINA
log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
log4j.appender.CATALINA.DatePattern='.'yyyy-MM-dd
log4j.appender.CATALINA.File=${catalina.home}/logs/catalina.out
log4j.appender.CATALINA.threshold=info
log4j.appender.CATALINA.layout=org.apache.log4j.PatternLayout
log4j.appender.CATALINA.layout.ConversionPattern=%d:%p %c{2} - %m%n

After couple of days, I saw some catalina.out files suffix with ".x.gz",
where x is number range from 1 to 30. May I know to get rid of these files?

I only want log4j to handle the file rotation as configured in
log4j.properties.

Thank you.

Regards,
SamKong Goo

Re: Logging Requirement in Tomcat 5.5.16

Posted by Goo Sam Kong <sk...@gmail.com>.
Thanks Andre,

I saw there is a script doing zip in /etc. I am new to Linux, :-).

On 21 April 2010 17:45, André Warnier <aw...@ice-sa.com> wrote:

> Goo Sam Kong wrote:
>
>> Hi Pid,
>>
>> My answer below.
>>
>> I saw the same file names in another server (not implement log4j yet),
>> that
>> server is running on default logging (Tomcat Juli).
>>
>> I think Tomcat by default created those extra zip files, I would like to
>> know how to disable that.
>>
>
> Tomcat does not create gzipped logfiles.
> I would venture that the most likely candidate for this is that you have a
> logrotate script which runs under cron from time to time, and which does it.
> If you are under Linux, start with the /etc directory and look for anything
> that mentions logrotate, maybe starting in the /etc/cron.* directories.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Logging Requirement in Tomcat 5.5.16

Posted by André Warnier <aw...@ice-sa.com>.
Goo Sam Kong wrote:
> Hi Pid,
> 
> My answer below.
> 
> I saw the same file names in another server (not implement log4j yet), that
> server is running on default logging (Tomcat Juli).
> 
> I think Tomcat by default created those extra zip files, I would like to
> know how to disable that.

Tomcat does not create gzipped logfiles.
I would venture that the most likely candidate for this is that you have 
a logrotate script which runs under cron from time to time, and which 
does it.
If you are under Linux, start with the /etc directory and look for 
anything that mentions logrotate, maybe starting in the /etc/cron.* 
directories.


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


Re: Logging Requirement in Tomcat 5.5.16

Posted by Goo Sam Kong <sk...@gmail.com>.
Hi Pid,

My answer below.

I saw the same file names in another server (not implement log4j yet), that
server is running on default logging (Tomcat Juli).

I think Tomcat by default created those extra zip files, I would like to
know how to disable that.

On 21 April 2010 17:00, Pid <pi...@pidster.com> wrote:

> On 21/04/2010 09:49, Pid wrote:
> > On 21/04/2010 09:35, Goo Sam Kong wrote:
> >> Oops, type too fast. I want catalina.out to be rotate daily but Tomcat
> >> give me extra files (catalina.out.1.gz, catalina.out.2.gz...catalina.
> >> out.30.gz). I don't want those extra files. Any chance to disable that?
> >
> > Sorry, my mistake, I misread your email.
> >
> > Also:
> >
> >
> http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html
> >
> > seems to say that DailyRollingFileAppender isn't a good choice.
> >
> >> The extra files are generated by Tomcat by default? I do not specify
> >> those file rotation anywhere.
> >
> > Tomcat doesn't tar & gzip files by default.  How are you starting
> > Tomcat, using a script like /etc/init.d/tomcat?
>
> (I need a coffee.)
>
> So, I'm not asking the right questions here.  To recap:
>
> 1. What log files *are* being generated?  Are you getting
> catalina.2010-04-01.log, catalina.2010-04-02.log etc?
> Sam: Yes
>


> 2. If so, are they in addition to the catalina.1.tar.gz type files?
> Sam: The file name is catalina.out.1.gz and so on
>


> 3. How big are is the compressed tar.gz and and how big is the file when
> it's unpacked?
> Sam: Same contents as catalina.out.yyyy.mm.dd
>


> 4. Did you post the entire log4j.properties or are there other parts to
> it?  E.g. Are there MaxBackupIndex and MaxFileSize settings?  If not,
> try adding one set to -1 and 0.
> Sam: I posted entire log4j.properties in my previous email.
>
> p
>
>
> >> On 21 April 2010 16:32, Goo Sam Kong <skgoo88@gmail.com
> >> <ma...@gmail.com>> wrote:
> >>
> >>     I want catalina.out to be rotate daily but Tomcat give me extra
> >>     files (catalina.out.1.gz, catalina.out.2.gz...catalina.out.30.gz). I
> >>     don't those extra files. Any chance to disable that?
> >>
> >>
> >>     On 21 April 2010 16:26, Pid <pid@pidster.com
> >>     <ma...@pidster.com>> wrote:
> >>
> >>         On 21/04/2010 09:07, Goo Sam Kong wrote:
> >>         > Hi,
> >>         >
> >>         > I am using Log4j logging in Tomcat 5.5.16 with JDK 1.5.0
> >>         update 7 on RedHat
> >>         > Linux server.
> >>         >
> >>         > I followed the instructions on
> >>         > http://tomcat.apache.org/tomcat-5.5-doc/logging.html to copy
> the
> >>         > commons-logging-1.0.4.jar and log4j.jar into
> >>         $CATALINA_HOME/common/lib
> >>         > directory.
> >>         >
> >>         > and created log4j.properties in $CATALINA_HOME/common/classes
> >>         directory as
> >>         > below:
> >>         >
> >>         > log4j.rootLogger=info, CATALINA
> >>         >
> log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
> >>         > log4j.appender.CATALINA.DatePattern='.'yyyy-MM-dd
> >>         >
> log4j.appender.CATALINA.File=${catalina.home}/logs/catalina.out
> >>         > log4j.appender.CATALINA.threshold=info
> >>         > log4j.appender.CATALINA.layout=org.apache.log4j.PatternLayout
> >>         > log4j.appender.CATALINA.layout.ConversionPattern=%d:%p %c{2} -
> >>         %m%n
> >>         >
> >>         > After couple of days, I saw some catalina.out files suffix
> >>         with ".x.gz",
> >>         > where x is number range from 1 to 30. May I know to get rid of
> >>         these files?
> >>         >
> >>         > I only want log4j to handle the file rotation as configured in
> >>         > log4j.properties.
> >>
> >>         You've configured a DailyRollingFileAppender with DatePattern
> >>         DatePattern set to ".yyyy-MM-dd" so the log files are being
> >>         rotated daily.
> >>
> >>         What were you intending it to do?
> >>
> >>
> >>         p
> >>
> >>
> >>
> >>         > Thank you.
> >>         >
> >>         > Regards,
> >>         > SamKong Goo
> >>         >
> >>
> >>
> >>
> >>
> >
> >
> >
> >
>
>
>

Re: Logging Requirement in Tomcat 5.5.16

Posted by Pid <pi...@pidster.com>.
On 21/04/2010 09:49, Pid wrote:
> On 21/04/2010 09:35, Goo Sam Kong wrote:
>> Oops, type too fast. I want catalina.out to be rotate daily but Tomcat
>> give me extra files (catalina.out.1.gz, catalina.out.2.gz...catalina.
>> out.30.gz). I don't want those extra files. Any chance to disable that?
> 
> Sorry, my mistake, I misread your email.
> 
> Also:
> 
> http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html
> 
> seems to say that DailyRollingFileAppender isn't a good choice.
> 
>> The extra files are generated by Tomcat by default? I do not specify
>> those file rotation anywhere.
> 
> Tomcat doesn't tar & gzip files by default.  How are you starting
> Tomcat, using a script like /etc/init.d/tomcat?

(I need a coffee.)

So, I'm not asking the right questions here.  To recap:

1. What log files *are* being generated?  Are you getting
catalina.2010-04-01.log, catalina.2010-04-02.log etc?

2. If so, are they in addition to the catalina.1.tar.gz type files?

3. How big are is the compressed tar.gz and and how big is the file when
it's unpacked?

4. Did you post the entire log4j.properties or are there other parts to
it?  E.g. Are there MaxBackupIndex and MaxFileSize settings?  If not,
try adding one set to -1 and 0.


p


>> On 21 April 2010 16:32, Goo Sam Kong <skgoo88@gmail.com
>> <ma...@gmail.com>> wrote:
>>
>>     I want catalina.out to be rotate daily but Tomcat give me extra
>>     files (catalina.out.1.gz, catalina.out.2.gz...catalina.out.30.gz). I
>>     don't those extra files. Any chance to disable that?
>>
>>
>>     On 21 April 2010 16:26, Pid <pid@pidster.com
>>     <ma...@pidster.com>> wrote:
>>
>>         On 21/04/2010 09:07, Goo Sam Kong wrote:
>>         > Hi,
>>         >
>>         > I am using Log4j logging in Tomcat 5.5.16 with JDK 1.5.0
>>         update 7 on RedHat
>>         > Linux server.
>>         >
>>         > I followed the instructions on
>>         > http://tomcat.apache.org/tomcat-5.5-doc/logging.html to copy the
>>         > commons-logging-1.0.4.jar and log4j.jar into
>>         $CATALINA_HOME/common/lib
>>         > directory.
>>         >
>>         > and created log4j.properties in $CATALINA_HOME/common/classes
>>         directory as
>>         > below:
>>         >
>>         > log4j.rootLogger=info, CATALINA
>>         > log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
>>         > log4j.appender.CATALINA.DatePattern='.'yyyy-MM-dd
>>         > log4j.appender.CATALINA.File=${catalina.home}/logs/catalina.out
>>         > log4j.appender.CATALINA.threshold=info
>>         > log4j.appender.CATALINA.layout=org.apache.log4j.PatternLayout
>>         > log4j.appender.CATALINA.layout.ConversionPattern=%d:%p %c{2} -
>>         %m%n
>>         >
>>         > After couple of days, I saw some catalina.out files suffix
>>         with ".x.gz",
>>         > where x is number range from 1 to 30. May I know to get rid of
>>         these files?
>>         >
>>         > I only want log4j to handle the file rotation as configured in
>>         > log4j.properties.
>>
>>         You've configured a DailyRollingFileAppender with DatePattern
>>         DatePattern set to ".yyyy-MM-dd" so the log files are being
>>         rotated daily.
>>
>>         What were you intending it to do?
>>
>>
>>         p
>>
>>
>>
>>         > Thank you.
>>         >
>>         > Regards,
>>         > SamKong Goo
>>         >
>>
>>
>>
>>
> 
> 
> 
> 



Re: Logging Requirement in Tomcat 5.5.16

Posted by Pid <pi...@pidster.com>.
On 21/04/2010 09:35, Goo Sam Kong wrote:
> Oops, type too fast. I want catalina.out to be rotate daily but Tomcat
> give me extra files (catalina.out.1.gz, catalina.out.2.gz...catalina.
> out.30.gz). I don't want those extra files. Any chance to disable that?

Sorry, my mistake, I misread your email.

Also:

http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html

seems to say that DailyRollingFileAppender isn't a good choice.

> The extra files are generated by Tomcat by default? I do not specify
> those file rotation anywhere.

Tomcat doesn't tar & gzip files by default.  How are you starting
Tomcat, using a script like /etc/init.d/tomcat?


p


> On 21 April 2010 16:32, Goo Sam Kong <skgoo88@gmail.com
> <ma...@gmail.com>> wrote:
> 
>     I want catalina.out to be rotate daily but Tomcat give me extra
>     files (catalina.out.1.gz, catalina.out.2.gz...catalina.out.30.gz). I
>     don't those extra files. Any chance to disable that?
> 
> 
>     On 21 April 2010 16:26, Pid <pid@pidster.com
>     <ma...@pidster.com>> wrote:
> 
>         On 21/04/2010 09:07, Goo Sam Kong wrote:
>         > Hi,
>         >
>         > I am using Log4j logging in Tomcat 5.5.16 with JDK 1.5.0
>         update 7 on RedHat
>         > Linux server.
>         >
>         > I followed the instructions on
>         > http://tomcat.apache.org/tomcat-5.5-doc/logging.html to copy the
>         > commons-logging-1.0.4.jar and log4j.jar into
>         $CATALINA_HOME/common/lib
>         > directory.
>         >
>         > and created log4j.properties in $CATALINA_HOME/common/classes
>         directory as
>         > below:
>         >
>         > log4j.rootLogger=info, CATALINA
>         > log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
>         > log4j.appender.CATALINA.DatePattern='.'yyyy-MM-dd
>         > log4j.appender.CATALINA.File=${catalina.home}/logs/catalina.out
>         > log4j.appender.CATALINA.threshold=info
>         > log4j.appender.CATALINA.layout=org.apache.log4j.PatternLayout
>         > log4j.appender.CATALINA.layout.ConversionPattern=%d:%p %c{2} -
>         %m%n
>         >
>         > After couple of days, I saw some catalina.out files suffix
>         with ".x.gz",
>         > where x is number range from 1 to 30. May I know to get rid of
>         these files?
>         >
>         > I only want log4j to handle the file rotation as configured in
>         > log4j.properties.
> 
>         You've configured a DailyRollingFileAppender with DatePattern
>         DatePattern set to ".yyyy-MM-dd" so the log files are being
>         rotated daily.
> 
>         What were you intending it to do?
> 
> 
>         p
> 
> 
> 
>         > Thank you.
>         >
>         > Regards,
>         > SamKong Goo
>         >
> 
> 
> 
> 





Re: Logging Requirement in Tomcat 5.5.16

Posted by Goo Sam Kong <sk...@gmail.com>.
Oops, type too fast. I want catalina.out to be rotate daily but Tomcat give
me extra files (catalina.out.1.gz, catalina.out.2.gz...catalina.
out.30.gz). I don't want those extra files. Any chance to disable that?

The extra files are generated by Tomcat by default? I do not specify those
file rotation anywhere.


On 21 April 2010 16:32, Goo Sam Kong <sk...@gmail.com> wrote:

> I want catalina.out to be rotate daily but Tomcat give me extra files
> (catalina.out.1.gz, catalina.out.2.gz...catalina.out.30.gz). I don't those
> extra files. Any chance to disable that?
>
>
> On 21 April 2010 16:26, Pid <pi...@pidster.com> wrote:
>
>> On 21/04/2010 09:07, Goo Sam Kong wrote:
>> > Hi,
>> >
>> > I am using Log4j logging in Tomcat 5.5.16 with JDK 1.5.0 update 7 on
>> RedHat
>> > Linux server.
>> >
>> > I followed the instructions on
>> > http://tomcat.apache.org/tomcat-5.5-doc/logging.html to copy the
>> > commons-logging-1.0.4.jar and log4j.jar into $CATALINA_HOME/common/lib
>> > directory.
>> >
>> > and created log4j.properties in $CATALINA_HOME/common/classes directory
>> as
>> > below:
>> >
>> > log4j.rootLogger=info, CATALINA
>> > log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
>> > log4j.appender.CATALINA.DatePattern='.'yyyy-MM-dd
>> > log4j.appender.CATALINA.File=${catalina.home}/logs/catalina.out
>> > log4j.appender.CATALINA.threshold=info
>> > log4j.appender.CATALINA.layout=org.apache.log4j.PatternLayout
>> > log4j.appender.CATALINA.layout.ConversionPattern=%d:%p %c{2} - %m%n
>> >
>> > After couple of days, I saw some catalina.out files suffix with ".x.gz",
>> > where x is number range from 1 to 30. May I know to get rid of these
>> files?
>> >
>> > I only want log4j to handle the file rotation as configured in
>> > log4j.properties.
>>
>> You've configured a DailyRollingFileAppender with DatePattern
>> DatePattern set to ".yyyy-MM-dd" so the log files are being rotated daily.
>>
>> What were you intending it to do?
>>
>>
>> p
>>
>>
>>
>> > Thank you.
>> >
>> > Regards,
>> > SamKong Goo
>> >
>>
>>
>>
>

Re: Logging Requirement in Tomcat 5.5.16

Posted by Goo Sam Kong <sk...@gmail.com>.
I want catalina.out to be rotate daily but Tomcat give me extra files
(catalina.out.1.gz, catalina.out.2.gz...catalina.out.30.gz). I don't those
extra files. Any chance to disable that?

On 21 April 2010 16:26, Pid <pi...@pidster.com> wrote:

> On 21/04/2010 09:07, Goo Sam Kong wrote:
> > Hi,
> >
> > I am using Log4j logging in Tomcat 5.5.16 with JDK 1.5.0 update 7 on
> RedHat
> > Linux server.
> >
> > I followed the instructions on
> > http://tomcat.apache.org/tomcat-5.5-doc/logging.html to copy the
> > commons-logging-1.0.4.jar and log4j.jar into $CATALINA_HOME/common/lib
> > directory.
> >
> > and created log4j.properties in $CATALINA_HOME/common/classes directory
> as
> > below:
> >
> > log4j.rootLogger=info, CATALINA
> > log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
> > log4j.appender.CATALINA.DatePattern='.'yyyy-MM-dd
> > log4j.appender.CATALINA.File=${catalina.home}/logs/catalina.out
> > log4j.appender.CATALINA.threshold=info
> > log4j.appender.CATALINA.layout=org.apache.log4j.PatternLayout
> > log4j.appender.CATALINA.layout.ConversionPattern=%d:%p %c{2} - %m%n
> >
> > After couple of days, I saw some catalina.out files suffix with ".x.gz",
> > where x is number range from 1 to 30. May I know to get rid of these
> files?
> >
> > I only want log4j to handle the file rotation as configured in
> > log4j.properties.
>
> You've configured a DailyRollingFileAppender with DatePattern
> DatePattern set to ".yyyy-MM-dd" so the log files are being rotated daily.
>
> What were you intending it to do?
>
>
> p
>
>
>
> > Thank you.
> >
> > Regards,
> > SamKong Goo
> >
>
>
>

Re: Logging Requirement in Tomcat 5.5.16

Posted by Pid <pi...@pidster.com>.
On 21/04/2010 09:07, Goo Sam Kong wrote:
> Hi,
> 
> I am using Log4j logging in Tomcat 5.5.16 with JDK 1.5.0 update 7 on RedHat
> Linux server.
> 
> I followed the instructions on
> http://tomcat.apache.org/tomcat-5.5-doc/logging.html to copy the
> commons-logging-1.0.4.jar and log4j.jar into $CATALINA_HOME/common/lib
> directory.
> 
> and created log4j.properties in $CATALINA_HOME/common/classes directory as
> below:
> 
> log4j.rootLogger=info, CATALINA
> log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.CATALINA.DatePattern='.'yyyy-MM-dd
> log4j.appender.CATALINA.File=${catalina.home}/logs/catalina.out
> log4j.appender.CATALINA.threshold=info
> log4j.appender.CATALINA.layout=org.apache.log4j.PatternLayout
> log4j.appender.CATALINA.layout.ConversionPattern=%d:%p %c{2} - %m%n
> 
> After couple of days, I saw some catalina.out files suffix with ".x.gz",
> where x is number range from 1 to 30. May I know to get rid of these files?
> 
> I only want log4j to handle the file rotation as configured in
> log4j.properties.

You've configured a DailyRollingFileAppender with DatePattern
DatePattern set to ".yyyy-MM-dd" so the log files are being rotated daily.

What were you intending it to do?


p



> Thank you.
> 
> Regards,
> SamKong Goo
>