logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Schlossberg <danieleli1970-lo...@yahoo.com>
Subject RollingFileAppender fails to rollover on Win2k Tomcat as service
Date Tue, 25 Jul 2006 21:55:09 GMT
My RollingFileAppender recently stopped working but only when running Tomcat as a service in
Windows. What its doing is just overwriting the existing log once it reaches the MaxFileSize
threshold.
 
Interestingly, if I start tomcat  using the "catalina.bat jpda start" command the appender
works fine.  
 
I've also checked the permissions on the log directory and its set to full permissions for
everyone.  I've also tried running the service with my admin user account.
 
This problem just recently manifested and I'm wondering if maybe it has something to do with
a windows patch  our system admins might have applied.
 
Another interesting observation.  If I go into the log4j.properties file and change the appender.File
name to something else "promotions2.log" it starts to work.  I can then delete the original
file "promotions.log" and reset appender.File to "promotions.log" and once again it doesn't
work.  Furthermore, I can now switch it back to "promotions2.log" and it still doesn't work!
 What the heck!?
 
Any help/work around would be great.  
 
 
Here is the setup:
Log4J:  1.2.12
 
Tomcat Version:  5.0.18
JVM Version:  1.5.0_06-b05
JVM Vendor:  Sun Microsystems Inc.
OS Name:  Windows 2000
OS Version:  5.0
OS Architecture:  x86

Log4j.properties file
log4j.debug=true
log4j.rootLogger=DEBUG, promotions
log4j.appender.promotions=org.apache.log4j.RollingFileAppender
log4j.appender.promotions.File=c:/logs/promotions.log
log4j.appender.promotions.MaxFileSize=50KB
log4j.appender.promotions.MaxBackupIndex=9
log4j.appender.promotions.layout=org.apache.log4j.PatternLayout
log4j.appender.promotions.layout.ConversionPattern=[%p] [%d{DATE}] (%C:%M:%L) - %m%n
log4j.logger.net.sf.hibernate=DEBUG
 
 
As you can see, I've got debuging turned on for log4j but it claims that it is successfully
renaming the files as indicated below in the tomcat stdout.log
log4j: rolling over count=51264
log4j: maxBackupIndex=9
log4j: Renaming file c:\logs\promotions.log to c:\logs\promotions.log.1
log4j: setFile called: c:/logs/promotions.log, false
log4j: setFile ended
log4j: rolling over count=51556
log4j: maxBackupIndex=9
log4j: Renaming file c:\logs\promotions.log to c:\logs\promotions.log.1
log4j: setFile called: c:/logs/promotions.log, false
log4j: setFile ended
log4j: rolling over count=51853
log4j: maxBackupIndex=9
log4j: Renaming file c:\logs\promotions.log to c:\logs\promotions.log.1
log4j: setFile called: c:/logs/promotions.log, false
log4j: setFile ended

Thanks, Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message