-
1. Re: Help with JBOSS Log Configuration
johnloo1 Feb 23, 2009 2:44 PM (in response to johnloo1)Sorry! Unfamiliar with this BBS... Let me try again..:
I am having a problem re-configuring the JBOSS log files. I am running 4.0.1SP1. I had the log files configured like this, which pretty much is the config supplied by the third-party app vendor:<!-- 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="${jboss.server.home.dir}/log/server.log"/> <param name="Append" value="false"/> <!-- 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>
This produced daily log files, and only a little bit of boot.log output. I decided that I wanted a size-based logging system, so I altered the log4j.xml file to remove the above, and substituted this:<!-- 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.home.dir}/log/server.log"/> <param name="Append" value="true"/> <param name="MaxFileSize" value="10MB"/> <param name="MaxBackupIndex" value="25"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/> </layout> </appender>
After saving the log4j.xml file, I restarted the JBOSS server. Now, I get no server log files, only a boot.log file that seems to be growing at the rate of 2MB / min.
What am I missing?? Something simple, I'm sure. TIA for the help! -
2. Re: Help with JBOSS Log Configuration
peterj Feb 23, 2009 3:56 PM (in response to johnloo1)The boot.log is configured via the log4j.properties file located within bin.run.jar. Once the app sever has been bootstrapped, that configuration is dropped and the conf/log4j.xml configuration used for logging instead.
I pasted your RollingFileAppender configuration into my log4j.xml file and it worked just fine. But I used 4.0.2, not 4.0.1.SP1.
The last two lines in my boot.log file are:
12:52:57,788 DEBUG [Log4jService] Creating jboss.system:type=Log4jService,service=Logging
12:52:57,788 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
Do you have anything like this in your boot.log file? Or is there an error? -
3. Re: Help with JBOSS Log Configuration
johnloo1 Feb 23, 2009 5:45 PM (in response to johnloo1)"PeterJ" wrote:
The boot.log is configured via the log4j.properties file located within bin.run.jar. Once the app sever has been bootstrapped, that configuration is dropped and the conf/log4j.xml configuration used for logging instead.
I pasted your RollingFileAppender configuration into my log4j.xml file and it worked just fine. But I used 4.0.2, not 4.0.1.SP1.
The last two lines in my boot.log file are:
12:52:57,788 DEBUG [Log4jService] Creating jboss.system:type=Log4jService,service=Logging
12:52:57,788 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
Do you have anything like this in your boot.log file? Or is there an error?
Those lines appear about 1.4 seconds after the first record in the boot.log file. But the system continues to append additional lines into boot.log. Here are the next few lines after the ones you noted:
10:12:53,983 DEBUG [Log4jService] Installed System.out adapter
10:12:53,983 DEBUG [Log4jService] Installed System.err adapter
10:12:53,999 DEBUG [Log4jService] Added ThrowableListener: org.jboss.logging.Log4jService$ThrowableListenerLoggingAdapter@e35bb7
10:12:53,999 DEBUG [Log4jService] Created jboss.system:type=Log4jService,service=Logging
10:12:53,999 DEBUG [LocalJBossServerDomain] handleNotification: javax.management.Notification[source=jboss.system:service=ServiceController][type= org.jboss.system.ServiceMBean.create][message=]
10:12:53,999 DEBUG [DefaultManagedObjectFactoryMap] Failed to find factory for event: javax.management.Notification[source=jboss.system:service=ServiceController][type= org.jboss.system.ServiceMBean.create][message=]
10:12:53,999 DEBUG [ServiceController] Creating dependent components for: jboss.system:type=Log4jService,service=Logging dependents are: []
10:12:53,999 DEBUG [ServiceController] Creating service jboss.rmi:type=RMIClassLoader
10:12:53,999 DEBUG [LocalJBossServerDomain] handleNotification: javax.management.Notification[source=jboss.system:service=ServiceController][type= org.jboss.system.ServiceMBean.create][message=]
10:12:53,999 DEBUG [DefaultManagedObjectFactoryMap] Failed to find factory for event: javax.management.Notification[source=jboss.system:service=ServiceController][type= org.jboss.system.ServiceMBean.create][message=]
10:12:53,999 DEBUG [ServiceController] Creating dependent components for: jboss.rmi:type=RMIClassLoader dependents are: []
10:12:53,999 DEBUG [ServiceController] Creating service jboss:service=WebService
10:12:53,999 DEBUG [WebService] Creating jboss:service=WebService
10:12:53,999 INFO [WebService] Using RMI server codebase: http://cgusrd11:8083/
10:12:53,999 DEBUG [WebService] Created jboss:service=WebService
It continues on and on... -
4. Re: Help with JBOSS Log Configuration
peterj Feb 23, 2009 5:48 PM (in response to johnloo1)You should have also posted those two lines from your log file...
-
5. Re: Help with JBOSS Log Configuration
johnloo1 Feb 23, 2009 8:25 PM (in response to johnloo1)Soory, I didn't post them because they were exactly as you had them posted, other than the timestamp.
-
6. Re: Help with JBOSS Log Configuration
peterj Feb 24, 2009 10:57 AM (in response to johnloo1)Sounds like debugging time to me, then. Try changing the log4j.xml file back to the way it was and see if the logging goes back to the way it used to be. If it doesn't, then there is another log4j.xml file somewhere in the classpath. Too bad that the "Configuring from URL: resource:log4j.xml " message doesn't give a full path, that would help.
-
7. Re: Help with JBOSS Log Configuration
jpmigue Feb 26, 2009 6:25 AM (in response to johnloo1)Had exactly the same problem. Turns out this was caused by not commenting out the whole stanza:
<!-- <appender> . . . </appender> -->
in the supplied time/date based rolling appender configuration -
8. Re: Help with JBOSS Log Configuration
peterj Feb 26, 2009 10:26 AM (in response to johnloo1)And when you comment out the whole stanza, make sure that there are no embedded comments. In other words, this will not work:
<!-- <appender> . <!-- some embedded comment --> . . </appender> -->
And the default FILE appender has embedded comments!
Situations like this are where an editor that does XML code highlighting is very handy.