"trustin" wrote : What about writing a RollingFileAppender that rolls when a log
file grows up to a certain size (e.g. 4MB) and keep only several old logs (e.g. 10 x 4 =
40MB at max)? Should be pretty useful for development - shorter editor startup time and
no worries for disk space.
|
|
It's already there in log4j :) It's commented out in the jboss-log4j.xml:
| <!-- A size based file rolling appender
| <appender name="FILE"
class="org.jboss.logging.appender.RollingFileAppender">
| <errorHandler
class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
| <param name="File"
value="${jboss.server.log.dir}/server.log"/>
| <param name="Append" value="false"/>
| <param name="MaxFileSize" value="500KB"/>
| <param name="MaxBackupIndex" value="1"/>
|
| <layout class="org.apache.log4j.PatternLayout">
| <param name="ConversionPattern" value="%d %-5p [%c]
%m%n"/>
| </layout>
| </appender>
| -->
I think it might make sense to have this size based rolling file appender (with
Append=true) as default *even in production* instead of the time based appender. This way
we don't have to worry about the log file growing to a large size even in production
environment (imagine the user application doing a lot of logging or some other reason)
during a day.
All we have to do is switch the "FILE" appender in jboss-log4j.xml to
RollingFileAppender and set the maxfilesize and maxbackupindex to a reasonable value and
also set append =true.
Thoughts?
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227119#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...