tags:

views:

324

answers:

4

I didn't get a definitive answer to this question by Google'ing, so I pose it to the groupthink masterminds and to ensure that a quality answer can be Google-able in the future.

Using log4j RollingFileAppender, I can set the maximum size I want the file to reach before rolling over on itself, like so:

RollingFileAppender rfa = new RollingFileAppender();
rfa.setMaximumFileSize(500000000); // Sets the max file size to 500MB

Now, what if I don't ever want this file to be rolled over? How do I set the RollingFileAppender maximum file size to unlimited?

+2  A: 

Just use Long.MAX_VALUE. Then you're already on a technical limit.

BalusC
+1 - This is a GREAT idea I didn't even think about!
KG
+2  A: 

Just use a FileAppender.

erickson
+5  A: 

RollingFileAppender extends FileAppender to backup the log files when they reach a certain size.

If you don't want to roll it over, then simply use FileAppender.

Bozho
+1  A: 

talking peanuts:

make sure your filesystem does support the filesize you want to achive. technically it will never be an unlimited filesize due to filesystem restrictions.

nheid