Below is the code i used to generate the log files using log4j and then roll it based on size. Files are getting generated, however the files are not rolling over based on Max File size. I heard in one post that we have to use apache-log4j-extras and am using apache-log4j-extras-1.2.17. I tried to roll over once 50KB has been reached, but its not rolling over. Can someone please let me know what could have gone wrong?
Am using log4j-1.2.17 and apache-log4j-extras-1.2.17 version of jar.
log4j.appender.Flows=org.apache.log4j.RollingFileAppender
log4j.appender.Flows.File=E:/Logs/Flows.log
log4j.appender.Flows.MaxFileSize=50KB
log4j.appender.Flows.MaxBackupIndex=2
log4j.appender.Flows.layout=org.apache.log4j.PatternLayout
log4j.appender.Flows.layout.ConversionPattern=%d %-5p - %c %x %m%n
Best Answer
If you are using Apache Extras™ for Apache log4j™, you may want to use
org.apache.log4j.rolling.RollingFileAppender
: