-
1. Re: log truncated on startup
peterj Jul 30, 2009 5:55 PM (in response to eflat)Every time your start the app server it will overwrite the log file. You can change this in server/xxx/conf/jboss-log4j.xml. Check the Log4J docs for what options are available. You can change the Append parameter to tru:
<appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender"> . . . <param name="Append" value="true"/> . . .
-
2. Re: log truncated on startup
eflat Jul 31, 2009 12:09 PM (in response to eflat)Yes, that got it -- thanks!
-
3. Re: log truncated on startup
agasthi_k May 11, 2011 11:22 PM (in response to peterj)Hi Peter,
I have customised my jboss-log4j.xml as below
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
<!-- ================================= -->
<!-- Preserve messages in a local file -->
<!-- ================================= -->
<!-- A time/date based rolling appender -->
<appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="/opt/www/logs/jboss/server.log"/>
<param name="Append" value="true"/>
Inspite of setting the Append param value to true, the jboss server.log file is getting truncated on every restart. Is there anything else I need to set ?
Regards,
AK
-
4. Re: log truncated on startup
peterj May 12, 2011 2:43 PM (in response to agasthi_k)That always works for me. First, which version of JBoss AS? Second, try adding -Dlog4j.debug=true to the JAVA_OPTS in run.conf. That whould cause log4j to print some information about how it is going about initializing the logging - that might give you more information.
At least, I hope log4j.debug is the correct option, my Log4J book is at work and I'm at home. I'll double check tomorrow when I am in the office if you still have problems.
-
5. log truncated on startup
agasthi_k May 12, 2011 3:09 PM (in response to peterj)Thanks Peter for your quick response
I am using JBOSS 5.1 EAP version on a RHEL 5.3. I have enabled -Dlog4j.debug=true in the run.conf. Is there anything specifc I need to check about that ?
-
6. log truncated on startup
jaikiran May 13, 2011 1:29 AM (in response to agasthi_k)Aye Kay wrote:
<param name="File" value="/opt/www/logs/jboss/server.log"/>
<param name="Append" value="true"/>
Inspite of setting the Append param value to true, the jboss server.log file is getting truncated on every restart.
Just to be sure - you're checking the /opt/www/logs/jboss/server.log file, right?
-
7. log truncated on startup
peterj May 13, 2011 9:53 AM (in response to agasthi_k)Also, append works only if the existing log file is from the same day. If the log file is from a previous day, it will be renumbered and a new log created.
-
8. log truncated on startup
agasthi_k May 13, 2011 2:25 PM (in response to peterj)Yes Peter,
Its the file from the same day.
-
-
10. Re: log truncated on startup
agasthi_k Jun 4, 2011 11:12 PM (in response to eflat)Guys,
It was a miss from my end, was a custom setting used to echo out some details to the log file and this statement flushed the file at startup each time.
Thanks for your help.