6 Replies Latest reply on Jun 15, 2011 11:54 AM by Joshua Davis

    Configuring logging on jboss 6.0 M2

    Marcin Misiewicz Newbie

      Hi

       

      In the m1 of the jboss 6 there was a file jboss-log4j.xml in conf directory which I have been using to customize logging.

      After upgrade to m2 there is no such file. I can't even find any files related to the logging configuration I've searched for log4j or logging.properties.

       

      Does anybody can explain me how should I properly configure my ear application logging and how can I override default jboss settings ?

       

      Should I use java.util.logging or log4j configuration, where do I have to place the configuration file etc. ?

       

      Thanks in advance.

        • 1. Re: Configuring logging on jboss 6.0 M2
          Peter Johnson Master
          Look in the deploy directory at jboss-logging.xml.
          • 2. Re: Configuring logging on jboss 6.0 M2
            Marcin Misiewicz Newbie

            Thanks a lot.

             

            Now logging works as before.

             

            But unfortuantely I have two more questions related to logging.

             

            First one :

            Is it possible to put logging configuration file lets say logging.properties into my ear or do I have to change global jboss-logging.xml ?

             

            Second one:

            Is it possible to append all logs related to my ear application to my ear specific file appender.

            Something like server.log but only with logs comming from my application.

            Right now I have configured such a appender but it collects only logs from classess written by me, of course I can do something like this :

             

                 <logger category="foo.bar">
                      <level name="DEBUG" />
                      <handlers>
                           <handler-ref name="MYFILEHANDLER"/>
                      </handlers>
                 </logger>
            
             
            

             

            For all log categories which I'm interested in but it still don't solve the problem. Because myfilehandler collects the also the coming from different applications with the same category.

             

            It would be nice to have a log file similar to server.log but with entries filtered only to the one application.

             

            Thanks in advance.

            • 3. Re: Configuring logging on jboss 6.0 M2
              David Lloyd Master

              misqu23 wrote:

               

              Thanks a lot.

               

              Now logging works as before.

               

              But unfortuantely I have two more questions related to logging.

               

              First one :

              Is it possible to put logging configuration file lets say logging.properties into my ear or do I have to change global jboss-logging.xml ?


              You can put a jboss-logging.xml into your deployment to get customized per-deployment logging.

               

              misqu23 wrote:

              Second one:

              Is it possible to append all logs related to my ear application to my ear specific file appender.


              Yes and no.  The capability is there, but it's not fully tested in M2 yet.  You can give it a shot though.  Create a jboss-logging.xml descriptor for your application, and specify a new log context like this:

               

              <jboss-logging xmlns="urn:jboss:logging:6.0" context="MyAppLoggingContext">
                  <define-context name="MyAppLoggingContext"/>
              
                  <!-- Define a handler -->
              
                  <periodic-rotating-file-handler
                          file-name="/your/log/file"
                          name="MyHandler"
                          autoFlush="true"
                          append="true"
                          suffix=".yyyy-MM-dd">
                    <error-manager>
                       <only-once/>
                    </error-manager>
              
                    <formatter>
                       <pattern-formatter pattern="%d %-5p [%c] (%t) %m%n"/>
                    </formatter>
                  </periodic-rotating-file-handler>
              
                  <!-- Now you can define your own root logger... -->
              
                  <root-logger>
                    <level name="INFO"/>
                    <handlers>
                       <handler-ref name="MyHandler"/>
                    </handlers>
                 </root-logger>
              </jboss-logging>
              

               

              That should be about it.

               

              Message was edited by: David Lloyd (fixed some bad grammar)

              • 4. Re: Configuring logging on jboss 6.0 M2
                Jakub Probola Newbie

                Hi,

                 

                I do have a question about logging (or more precisely sending SNMP traps or syslog) in Jboss 6.0 M2.

                 

                I uncommented part related to SNMP in jboss-logging.xml file. I also put “<handler-ref name="TRAP_LOG"/>” into “logger” section.

                 

                Unfortunately  I got something like this (just after I save the file, without invoking a servlet):

                 

                23:08:03,515 INFO  [service] Restored bootstrap log handlers

                23:08:03,562 INFO  [service] Removing bootstrap log handlers

                23:08:03,687 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController

                ] Error installing to Instantiated::HANDLER:system:TRAP_LOG state=D

                escribed mode=On Demand requiredState=Installed: org.jboss.joinpoint.spi.Joinpoi

                ntException: Constructor not found org.jboss.logmanager.log4j.handlers.Log4jAppe

                nderHandler[] in [ReflectConstructorInfoImpl@7aa43b{[ReflectClassInfoImpl@1b44df

                2{name=org.apache.log4j.Appender}]}]

                        at org.jboss.joinpoint.plugins.Config.findConstructorInfo(Config.java:27

                5)

                 

                ….

                ….

                ….

                 

                23:08:03,703 WARN  [org.jboss.system.server.profileservice.hotdeploy.HDScanner]

                Failed to process changes: org.jboss.deployers.client.spi.IncompleteDeploymentEx

                ception: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

                 

                DEPLOYMENTS MISSING DEPENDENCIES:

                  Deployment "Logging:HANDLER_INSTALLER:system:org.apache:110" is missing the fo

                llowing dependencies:

                    Dependency "Logging:HANDLER:system:TRAP_LOG" (should be in state "Installed"

                , but is actually in state "**ERROR**")

                 

                DEPLOYMENTS IN ERROR:

                  Deployment "Logging:HANDLER:system:TRAP_LOG" is in error due to the following

                reason(s): **ERROR**, org.jboss.joinpoint.spi.JoinpointException: Constructor no

                t found org.jboss.logmanager.log4j.handlers.Log4jAppenderHandler[] in [ReflectCo

                nstructorInfoImpl@7aa43b{[ReflectClassInfoImpl@1b44df2{name=org.apache.log4j.App

                ender}]}]

                ….

                ….

                ….

                        at java.lang.Thread.run(Unknown Source)

                 

                 

                Files snmpTrapAppender_1_2_9.jar and log4j.jar I’ve placed in ‘lib’ folder(s)…

                 

                Can anyone help me/suggest me what is wrong? Any help is appreciated.

                 

                Thanks in advance

                Jakub

                • 5. Re: Configuring logging on jboss 6.0 M2
                  Marcin Misiewicz Newbie

                  Hi

                   

                  Right now I'm using the 6.M3 version of the JBoss.

                   

                  I have followed your advice but unfortunately I get the following exception :

                   

                   

                  12:22:54,777 ERROR [AbstractKernelController] Error installing to Instantiated: name=Logging:CONTEXT:smartoffice state=Described: java.lang.IllegalAccessException: Class org.jboss.reflect.plugins.introspection.ReflectionUtils can not access a member of class org.jboss.logmanager.LogContext with modifiers ""
                  at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:95) [:1.6.0_18]
                  at java.lang.reflect.Constructor.newInstance(Constructor.java:524) [:1.6.0_18]
                  at org.jboss.reflect.plugins.introspection.ReflectionUtils.newInstance(ReflectionUtils.java:149) [jboss-reflect.jar:2.2.0.Alpha4]
                  at org.jboss.reflect.plugins.introspection.ReflectConstructorInfoImpl.newInstance(ReflectConstructorInfoImpl.java:107) [jboss-reflect.jar:2.2.0.Alpha4]
                  at org.jboss.joinpoint.plugins.BasicConstructorJoinPoint.dispatch(BasicConstructorJoinPoint.java:81) [jboss-reflect.jar:2.2.0.Alpha4]
                  at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.dispatch(AOPConstructorJoinpoint.java:109) [jboss-aop-mc-int.jar:2.2.0.Alpha9]
                  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257) [jboss-kernel.jar:2.2.0.Alpha9]
                  at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47) [jboss-kernel.jar:2.2.0.Alpha9]
                  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125) [jboss-kernel.jar:2.2.0.Alpha9]
                  at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72) [jboss-kernel.jar:2.2.0.Alpha9]
                  at org.jboss.kernel.plugins.dependency.InstantiateAction.installActionInternal(InstantiateAction.java:67) [jboss-kernel.jar:2.2.0.Alpha9]
                  at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.Alpha9]
                  at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:377) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2042) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1081) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1320) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1244) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1137) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:892) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:639) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:180) [:2.2.0.Alpha4]
                  at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58) [:2.2.0.Alpha4]
                  at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) [:2.2.0.Alpha4]
                  at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.Alpha4]
                  at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.Alpha4]
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1857) [:2.2.0.Alpha4]
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1575) [:2.2.0.Alpha4]
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1596) [:2.2.0.Alpha4]
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1516) [:2.2.0.Alpha4]
                  at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:377) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2042) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1081) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1320) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1244) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1137) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:937) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:652) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:2008) [:2.2.0.Alpha4]
                  at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1101) [:2.2.0.Alpha4]
                  at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.Alpha4]
                  at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117) [:6.0.0.20100429-M3]
                  at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70) [:6.0.0.20100429-M3]
                  at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53) [:6.0.0.20100429-M3]
                  at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403) [:6.0.0.20100429-M3]
                  at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:377) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2042) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1081) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1320) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1244) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1137) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:892) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:639) [jboss-dependency.jar:2.2.0.Alpha9]
                  at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308) [:6.0.0.20100429-M3]
                  at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256) [:6.0.0.20100429-M3]
                  at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:97) [:6.0.0.20100429-M3]
                  at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
                  at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
                  at java.lang.Thread.run(Thread.java:636) [:1.6.0_18]
                   
                  
                  
                  

                   

                  I put the jboss-logging.xml into the META-INF of the application ear. I think this is the right place. Here is the content of the jboss-logging.xml file :

                   

                   

                  <?xml version="1.0" encoding="UTF-8"?>
                  
                  <logging xmlns="urn:jboss:logging:6.0" context="smartoffice">
                  
                       <define-context name="smartoffice" />
                  
                       <periodic-rotating-file-handler
                            file-name="${jboss.server.log.dir}/smart.log" name="smartoffice"
                            autoFlush="true" append="true" suffix=".yyyy-MM-dd">
                            <error-manager>
                                 <only-once />
                            </error-manager>
                  
                            <formatter>
                                 <pattern-formatter pattern="%d %-5p [%c] (%t) %s%E%n" />
                            </formatter>
                       </periodic-rotating-file-handler>
                  
                       <root-logger>
                            <level name="FINE" />
                            <handlers>
                                 <handler-ref name="smartoffice" />
                            </handlers>
                       </root-logger>
                       
                  </logging>
                  

                   

                  That's interesting that when I remove context="smartoffice" attribute, I get some logs into the smart.log file but the console log handler stops working with the following exception :

                   

                   

                  12:46:25,933 ERROR [AbstractKernelController] Error installing to Instantiated: name=Logging:CONTEXT:smartoffice state=Described: java.lang.IllegalAccessException: Class org.jboss.reflect.plugins.introspection.ReflectionUtils can not access a member of class org.jboss.logmanager.LogContext with modifiers ""
                       at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:95) [:1.6.0_18]
                       at java.lang.reflect.Constructor.newInstance(Constructor.java:524) [:1.6.0_18]
                       at org.jboss.reflect.plugins.introspection.ReflectionUtils.newInstance(ReflectionUtils.java:149) [jboss-reflect.jar:2.2.0.Alpha4]
                       at org.jboss.reflect.plugins.introspection.ReflectConstructorInfoImpl.newInstance(ReflectConstructorInfoImpl.java:107) [jboss-reflect.jar:2.2.0.Alpha4]
                       at org.jboss.joinpoint.plugins.BasicConstructorJoinPoint.dispatch(BasicConstructorJoinPoint.java:81) [jboss-reflect.jar:2.2.0.Alpha4]
                       at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.dispatch(AOPConstructorJoinpoint.java:109) [jboss-aop-mc-int.jar:2.2.0.Alpha9]
                       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:257) [jboss-kernel.jar:2.2.0.Alpha9]
                       at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47) [jboss-kernel.jar:2.2.0.Alpha9]
                       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:125) [jboss-kernel.jar:2.2.0.Alpha9]
                       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72) [jboss-kernel.jar:2.2.0.Alpha9]
                       at org.jboss.kernel.plugins.dependency.InstantiateAction.installActionInternal(InstantiateAction.java:67) [jboss-kernel.jar:2.2.0.Alpha9]
                       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.Alpha9]
                       at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:377) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2042) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1081) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1320) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1244) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1137) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:892) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:639) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:180) [:2.2.0.Alpha4]
                       at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58) [:2.2.0.Alpha4]
                       at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) [:2.2.0.Alpha4]
                       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.Alpha4]
                       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.Alpha4]
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1857) [:2.2.0.Alpha4]
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1575) [:2.2.0.Alpha4]
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1596) [:2.2.0.Alpha4]
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1516) [:2.2.0.Alpha4]
                       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:377) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2042) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1081) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1320) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1244) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1137) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:937) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:652) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:2008) [:2.2.0.Alpha4]
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1101) [:2.2.0.Alpha4]
                       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.Alpha4]
                       at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117) [:6.0.0.20100429-M3]
                       at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70) [:6.0.0.20100429-M3]
                       at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53) [:6.0.0.20100429-M3]
                       at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403) [:6.0.0.20100429-M3]
                       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:377) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2042) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1081) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1320) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1244) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1137) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:892) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:639) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308) [:6.0.0.20100429-M3]
                       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256) [:6.0.0.20100429-M3]
                       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:97) [:6.0.0.20100429-M3]
                       at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
                       at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
                       at java.lang.Thread.run(Thread.java:636) [:1.6.0_18]
                  
                  12:46:25,945 INFO  [service] Removing bootstrap log handlers
                  
                   
                  

                   

                  This is the last log message I get on the console.

                   

                  On the other hand when I use jboss-logging instead of logging tag in the configuration file (as you suggested) I get following exception :

                   

                   

                  12:36:25,599 ERROR [AbstractKernelController] Error installing to Parse: name=vfs:///home/misiek/dev/jboss-eas/server/default/deploy/pl.scentia.smartoffice.ear.ear state=PreParse mode=Manual requiredState=Parse: org.jboss.deployers.spi.DeploymentException: Error creating managed object for vfs:///home/misiek/dev/jboss-eas/server/default/deploy/pl.scentia.smartoffice.ear.ear
                       at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) [:2.2.0.Alpha4]
                       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:362) [:2.2.0.Alpha4]
                       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:322) [:2.2.0.Alpha4]
                       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:294) [:2.2.0.Alpha4]
                       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:234) [:2.2.0.Alpha4]
                       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.Alpha4]
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1857) [:2.2.0.Alpha4]
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1575) [:2.2.0.Alpha4]
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1516) [:2.2.0.Alpha4]
                       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:377) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2042) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1081) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1320) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1244) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1137) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:937) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:652) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:2008) [:2.2.0.Alpha4]
                       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1101) [:2.2.0.Alpha4]
                       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.Alpha4]
                       at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117) [:6.0.0.20100429-M3]
                       at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70) [:6.0.0.20100429-M3]
                       at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53) [:6.0.0.20100429-M3]
                       at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:403) [:6.0.0.20100429-M3]
                       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:377) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2042) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1081) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1320) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1244) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1137) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:892) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:639) [jboss-dependency.jar:2.2.0.Alpha9]
                       at org.jboss.system.server.profileservice.repository.AbstractProfileService.registerProfile(AbstractProfileService.java:308) [:6.0.0.20100429-M3]
                       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:256) [:6.0.0.20100429-M3]
                       at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:97) [:6.0.0.20100429-M3]
                       at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
                       at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]
                       at java.lang.Thread.run(Thread.java:636) [:1.6.0_18]
                  Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed to resolve global element {urn:jboss:logging:6.0}jboss-logging
                       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:195) [jbossxb.jar:2.0.2.Beta7]
                       at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:168) [jbossxb.jar:2.0.2.Beta7]
                       at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:229) [jbossxb.jar:2.0.2.Beta7]
                       at org.jboss.xb.util.JBossXBHelper.parse(JBossXBHelper.java:206) [jbossxb.jar:2.0.2.Beta7]
                       at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:137) [:2.2.0.Alpha4]
                       at org.jboss.deployers.vfs.spi.deployer.SchemaResolverDeployer.parse(SchemaResolverDeployer.java:121) [:2.2.0.Alpha4]
                       at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSParsingDeployer.java:315) [:2.2.0.Alpha4]
                       at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parseAndInit(AbstractVFSParsingDeployer.java:297) [:2.2.0.Alpha4]
                       at org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer.parse(AbstractVFSParsingDeployer.java:221) [:2.2.0.Alpha4]
                       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:348) [:2.2.0.Alpha4]
                       ... 36 more
                  Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Failed to resolve global element {urn:jboss:logging:6.0}jboss-logging
                       at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:191) [jbossxb.jar:2.0.2.Beta7]
                       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.startElement(SaxJBossXBParser.java:370) [jbossxb.jar:2.0.2.Beta7]
                       at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]
                       at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]
                       at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]
                       at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]
                       at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]
                       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]
                       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]
                       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]
                       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]
                       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]
                       at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]
                       at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) [xercesImpl.jar:6.0.0.20100429-M3]
                       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:191) [jbossxb.jar:2.0.2.Beta7]
                       ... 45 more
                  
                  • 6. Re: Configuring logging on jboss 6.0 M2
                    Joshua Davis Expert

                    I've tried this approach in JBoss AS 6.0.0.Final, and it seems to work... more or less.

                     

                    1. Copied {server.home}/deploy/jboss-logging.xml to META-INF/jboss-logging.xml in the EAR.   I'm using the maven-ear-plugin, so the file actually goes in my-ear/src/main/application/META-INF/jboss-logging.xml.
                    2. Edited the file, added   <define-context name="myapp"/> right after the <logging> element.
                    3. Removed the console handler and references.
                    4. Changed the file name in the periodic-rotating-file-handler to ${jboss.server.log.dir}/myapp.log
                    5. Deployed the app... there are a few DEBUG level messages in myapp.log about redefining system:org.apache, but they don't seem to be stopping the deployment.

                     

                    So basically, everything worked.

                     

                    Here's what I noticed, FWIW:

                    • <logging ... context="myapp"> did not work.   Lots of exceptions.
                    • The version of async handler that comes with JBoss AS 6.0.0.Final blows up.   Either replace jboss-logmanager.jar with a newer build or don't use it.
                    • The custom log file isn't created right away, even though the console output shows that it found the jboss-logging.xml resource.   That's not entirely unexpected, but it's a little disconcerting if you are impatient.