问题描述
我没有得到Google的确定答案,因此我将其提交给GroupThink Masterminds,并确保质量答案可以将来可以Google-Google-google.
使用log4j rollingfileappender,我可以在滚动之前设置我希望文件达到的最大尺寸,例如:
RollingFileAppender rfa = new RollingFileAppender(); rfa.setMaximumFileSize(500000000); // Sets the max file size to 500MB
现在,如果我永远不要希望将此文件翻倒?如何将rollingFileAppender最大文件大小设置为无限?
推荐答案
rollingfileappender扩展滤清器时,以备份日志文件达到一定尺寸时备份日志文件.
如果您不想翻新,则只需使用 FileAppender .
其他推荐答案
其他推荐答案
只需使用FileAppender.
问题描述
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?
推荐答案
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.
其他推荐答案
Just use Long.MAX_VALUE. Then you're already on a technical limit.
其他推荐答案
Just use a FileAppender.