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 <p...@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 <skgo...@gmail.com > >> <mailto:skgo...@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 <p...@pidster.com > >> <mailto:p...@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 > >> > > >> > >> > >> > >> > > > > > > > > > > >