-
1. Re: logging in jboss
peterj Mar 18, 2009 12:49 PM (in response to rasa)By "not working" do you mean that you are not getting a log file, or that the log file is not rolling over each day?
The default console appender is named CONSOLE, why didn't you just change that appender to use the rolling file appender? Based on what you have, only the orj.jboss.Main class will log anything to your appender. -
2. Re: logging in jboss
rasa Mar 20, 2009 5:25 AM (in response to rasa)Yes its working fine. I got it from the log4j and jboss docs.
But is there any option to do the same through the command given below."$JAVA" $JAVA_OPTS -XX:OnError="kill -3 %p;gdb -command=cmd - %p" \ -classpath "$JBOSS_CLASSPATH" \ org.jboss.Main "$@" > /usr/jboss/logs/consolelog.log 2>&1
In the above case how can i add Rolling appender facility. Can i specify the maximum file size and once its reached the peak then name it as log.1 and then contiue with the other.
Thanks and Regards
Rasa -
3. Re: logging in jboss
peterj Mar 20, 2009 4:16 PM (in response to rasa)What you are asking for is a "rolling console appender" - there is no such thing. If you want the logging statements that currently go to the console to instead be placed into a rolling file, you must switch the CONSOLE appender to use the RollingFileAppender.
-
4. Re: logging in jboss
rasa Mar 24, 2009 9:44 AM (in response to rasa)I have configured it as
<appender name="CONSOLE" class="org.jboss.logging.appender.DailyRollingFileAppender"> <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler" /> <param name="File" value="${jboss.server.home.dir}/log/console.log" /> <param name="Append" value="true" /> <param name="Threshold" value="INFO" /> <!-- Rollover at midnight each day --> <param name="DatePattern" value="'.'yyyy-MM-dd" /> <!-- Rollover at the top of each hour <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/> --> <layout class="org.apache.log4j.PatternLayout"> <!-- The default pattern: Date Priority [Category] Message\n --> <param name="ConversionPattern" value="%d %-5p [%c] %m%n" /> <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/> --> </layout> </appender>
And its working fine. But now one issue i am facing in the earlier case when i gives kill -3 processid then i used to get the Threaddump in my console.,But after this change i am not getting that. Anything wrong in my configuration or anything more i need to add in that. Please suggest a method.
Thanks and Regards
Rasa -
5. Re: logging in jboss
peterj Mar 24, 2009 1:26 PM (in response to rasa)Thread dumps do not go to the log file because the internal JVM code does the dump, it is not handled by any Java code. If you want thread dumps to show up in a file you will still need to redirect stdout/stderr to a file.
-
6. Re: logging in jboss
rasa Mar 25, 2009 2:30 AM (in response to rasa)But the CONSOLE gets stdout only rt? , so why its not printing it. I have checked the log4j.xml in run.jar
<param name="Target" value="System.out"/>
so i think it should print all the System.out stuffs rt ? , So any way jvm prints threaddump in stdout.
Please provide more idea about it.
Thanks and Regards
Rasa -
7. Re: logging in jboss
peterj Mar 25, 2009 1:40 PM (in response to rasa)But the CONSOLE gets stdout only rt?
Yes and no. Any Java code that writes to System.out will go to the logs. But as I said in my previous reply, the thread dump is written by the JVM (that is, it is done internally using C/C++ code). Therefore thread dumps will never appears in the logs. Note that when you generate a thread dump that the output does not use the logs conversion pattern - that is, no leading timestamp and such. -
8. Re: logging in jboss
rasa Mar 26, 2009 5:02 AM (in response to rasa)thanks peter, thanks for your kind attention.
So in that case i will have to go back to my previous configuration. But that case is also have one issue and the same i mentioned above. It is nothing but log size issue.
Thanks for your guidance
Rasa