logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Meir Yanovich <meiry...@gmail.com>
Subject Tomcat log4j doesn't roll files as supposed to
Date Thu, 08 Mar 2012 05:28:02 GMT
i have in my tomcat web application log4j that is configured like this :

   1. <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
   2.     <appender name="FILE" class="org.apache.log4j.RollingFileAppender"
   3.     <param name="Threshold" value="DEBUG"/>
   4.         <param name="maxFileSize" value="100KB"/>
   5.         <param name="maxBackupIndex" value="15"/>
   6.         <param name="File" value="${catalina.home}/logs/myapp_gw.log"
   7.         <param name="Append" value="true"/>
   8.         <layout class="org.apache.log4j.PatternLayout">
   9.             <param name="ConversionPattern" value=
   "%d{ISO8601} %t %-5p [%c{1}] %m%n "/>
   10.         </layout>
   11.     </appender>
   12. ...
   13. ....
   14. ...

configured 100kb just to get quick
test<http://www.javaranch.com/unit-testing.jsp>results , any way it
seams like log4j roll the log only once and each time
he detects that he need to make roll it just changes the previous file name
and keep outputting to the main log file , i set log4j debug mode and the
output it gives me looks like this :

log4j: rolling over count=820961
log4j: maxBackupIndex=15
log4j: Renaming file C:\Tomcat\logs\myapp_gw.log.8 to
log4j: Renaming file C:\Tomcat\logs\myapp_gw.log to
log4j: setFile called: C:\Tomcat/logs/myapp_gw.log, true
log4j: setFile ended

as you can see it renaming me the myapp_gw.log.8 to myapp_gw.log.9 but
doesn't keep the myapp_gw.log.8 ,
i need it to keep as i configured history of 15 files . what i need wrong
here ?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message