-
1. Re: default append setting to log/server.log is false
dimitris Mar 4, 2009 4:52 AM (in response to dimitris)Ok, I've set append mode to 'true' by default, which is a more logical production setting. Either this, or a developer needs to switch to a standard FileAppender that always recreates the log from scratch and doesn't keep any memory.
-
2. Re: default append setting to log/server.log is false
jaikiran Mar 26, 2009 10:59 AM (in response to dimitris)Now that this param is set to true, do you think it would be better to by default use a size based rolling file appender (for server.log) instead of the time based daily rolling appender.
I keep restarting my dev system multiple times a day and just noticed that the size of the server.log had grown up to 300 MB :) -
3. Re: default append setting to log/server.log is false
jaikiran Mar 26, 2009 12:57 PM (in response to dimitris)Hmm, i think the answer to my question lies in your previous post.
"jaikiran" wrote:
I keep restarting my dev system multiple times a day and just noticed that the size of the server.log had grown up to 300 MB :)"dimitris@jboss.org" wrote:
I've set append mode to 'true' by default, which is a more logical production setting
So on dev systems, i will configure this to my liking (i.e. append=false) :) -
4. Re: default append setting to log/server.log is false
dimitris Apr 24, 2009 8:41 AM (in response to dimitris)For development a standard FileAppender (non-rollgin) with append=false suits better, yes.
-
5. Re: default append setting to log/server.log is false
trustin Apr 27, 2009 8:20 AM (in response to dimitris)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.
-
6. Re: default append setting to log/server.log is false
jaikiran Apr 27, 2009 11:50 PM (in response to dimitris)"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?