8 Replies Latest reply on Feb 26, 2009 10:26 AM by Peter Johnson

    Help with JBOSS Log Configuration

    John Loo Newbie

      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 -->





      <!-- 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"/>
      -->


      <!-- The default pattern: Date Priority [Category] Message\n -->


      <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n

      -->



      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 -->












      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!

        • 1. Re: Help with JBOSS Log Configuration
          John Loo Newbie

          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
            Peter Johnson Master

            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
              John Loo Newbie

               

              "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
                Peter Johnson Master

                You should have also posted those two lines from your log file...

                • 5. Re: Help with JBOSS Log Configuration
                  John Loo Newbie

                  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
                    Peter Johnson Master

                    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 Newbie

                      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
                        Peter Johnson Master

                        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.