Results 1 to 3 of 3
- 10-08-2012, 03:30 PM #1
Member
- Join Date
- Oct 2012
- Posts
- 2
- Rep Power
- 0
Maximum Backup Size in Log4J ERROR
I use log4j in my applications for manage the log files. Now, I want to manage the number of backups and the maximum log size. For this, I use two methods of the API of log4j:
setMaxBackupIndex(int maxBackups);
setMaximumFileSize(long maxSize);
The first works correctly, but the second not works. I configure the maximum size in 1024 bytes but the size of the files is 1066 bytes.
Anyone know how fix it?
Thanks! Regards, yebenes.
- 10-08-2012, 09:07 PM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
Re: Maximum Backup Size in Log4J ERROR
This happens because of the way RollingFileAdapter works (which I presume you are using because you did not include much information otherwise) - it appends, then checks maximum file size and rolls over (for the next append) if the file size is equal to or exceeds the maximum set value.
- 10-09-2012, 09:33 AM #3
Member
- Join Date
- Oct 2012
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
JPanel getSize() getWidth(); also force maximum size?
By AcousticBruce in forum New To JavaReplies: 3Last Post: 02-23-2011, 04:22 AM -
get maximum heap size that can be allocated
By gautam.aditya97 in forum Java 2DReplies: 3Last Post: 04-05-2010, 05:03 AM -
Maximum size of POST to Servlet
By Ward in forum Java ServletReplies: 0Last Post: 03-04-2009, 11:35 AM -
Maximum size permited in the parameters in actions and servlets
By Eric in forum Java ServletReplies: 2Last Post: 07-03-2007, 04:09 PM -
Maximum size of an array
By Hasan in forum New To JavaReplies: 1Last Post: 05-20-2007, 11:11 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks