• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Log4j doesn't split the log files as it supposed to

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the following appender as the properties file to configure log4j:

<appender name="errorAppender" class="org.apache.log4j.RollingFileAppender">
<param name="Threshold" value="ERROR" />
<param name="File" value="C:/Data/logs/error.log" />
<param name="MaxFileSize" value="5MB" />
<param name="MaxBackupIndex" value="3" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %c{1} %-4r %-5p %x - %m%n" />
</layout>
</appender>

Even though, the file that it creates got so far to the monster size of 12MB although as far as I understand log4j should have stop when the file reached 5MB and start another file.
What do I do wrong?
 
Ranch Hand
Posts: 174
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post your complete log4j.xml file ?
 
Guy Roth
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With pleasure. It goes as following:



 
That which doesn't kill us makes us stronger. I think a piece of pie wouldn't kill me. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!