I have an application running on Websphere in a Windows server environment utilizing log4j. The system is logging and appears to be adhering to the MaxFileSize limit as defined in the log4j.properties (20KB - see below), but is not rolling the log files. Rather, it is simply overwriting the existing log file.
Here is my log4j.properties file defined in Websphere:
log4j.rootLogger=debug, file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=F:\\<log_file_directory\\<log_file_name>.log
log4j.appender.file.MaxFileSize=20KB
log4j.appender.file.MaxBackupIndex=50
log4j.appender.file.Append=true
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
My theory is that the application / JVM is holding on to a reference to the log file when log4j tries to roll the file, and that Windows is seeing that file in use and preventing it from being moved. But I don't know this for sure.
Anyone see any reason why the log files wouldn't be rolling over? Or could my theory be correct?