You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by julie gautier <ju...@yahoo.fr> on 2007/02/12 15:37:15 UTC
Problem with MaxBackupIndex
Hi,
Here is my log4j.properties file content :
log4j.rootLogger=OFF,
log4j.logger.com.foo=DEBUG, stdout, R
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss} (%F:%L) - %m%n
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=C:\\myfile.log
log4j.appender.R.MaxFileSize=1000KB
log4j.appender.R.MaxBackupIndex=5
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss} (%F:%L) - %m%n
The problem is only one file is kept in backup instead of 5 as expected (myfile.log, myfile.log.1, myfile.log.2, ...).
Once the myfile.log reached 1000KB, it clears itself and restart to 0 KB.
Why ? It used to work but I can't see what the problem is now. I passed from Tomcat 5.0 to Tomcat 5.5, could it be related ?
Thanks for helping !
---------------------------------
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses.