0 Replies Latest reply on Feb 8, 2011 6:47 AM by Lennart Petersson

    Errors during boot if log4j ROOT level is set to TRACE

    Lennart Petersson Novice

      JBoss community version 5.1.0.GA

       

      Problem with configuring jboss-log4j.xml. Has a couple of appenders filtering using TCLMCFilter. To be able to use TRACE log level for an appender during test i thought it would be a good thing to set the property -Djboss.server.log.threshold=TRACE during local tests. But that turned out in the following in the log file (log4j debug turned on):

       

      12:41:07,512 INFO  [ProfileServiceBootstrap] Loading profile: ProfileKey@483bead5[domain=default, server=default, name=default]

      log4j: Threshold ="null".

      log4j: Level value for root is  [TRACE].

      log4j: root level set to TRACE

      log4j:WARN No appenders could be found for logger (org.jboss.classloader.spi.base.BaseClassLoader).

      log4j:WARN Please initialize the log4j system properly.

      log4j: Class name: [org.apache.log4j.ConsoleAppender]

      log4j: Setting property [target] to [System.out].

      log4j: Setting property [threshold] to [INFO].

      log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"

      log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %-5p [%c{1}] %m%n].

      log4j: Adding appender named [CONSOLE] to category [root].

      log4j: Class name: [org.jboss.logging.appender.DailyRollingFileAppender]

      log4j: Setting property [file] to [/xxxxx/jboss/outer/server/default/log/server.log].

      log4j: Setting property [append] to [true].

      log4j: Setting property [threshold] to [INFO].

      log4j: Setting property [datePattern] to ['.'yyyy-MM-dd].

      log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"

      log4j: Setting property [conversionPattern] to [%d %-5p [%c] (%t) %m%n].

      log4j: setFile called: /xxxxx/jboss/outer/server/default/log/server.log, true

      log4j: setFile ended

      log4j: Appender [FILE] to be rolled at midnight.

      log4j: Adding appender named [FILE] to category [root].

      log4j: Class name: [org.jboss.logging.appender.DailyRollingFileAppender]

      log4j: Setting property [file] to [/xxxxx/jboss/outer/server/default/log/error.log].

      log4j: Setting property [append] to [true].

      log4j: Setting property [threshold] to [ERROR].

      log4j: Setting property [datePattern] to ['.'yyyy-MM-dd].

      log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"

      log4j: Setting property [conversionPattern] to [%d %-5p [%t] [%c] %m%n].

      log4j: setFile called: /xxxxx/jboss/outer/server/default/log/error.log, true

      log4j: setFile ended

      log4j: Appender [ERROR] to be rolled at midnight.

      log4j: Adding appender named [ERROR] to category [root].

      log4j: Class name: [org.jboss.logging.appender.DailyRollingFileAppender]

      log4j: Setting property [file] to [/xxxxx/jboss/outer/server/default/log/xxxxx.log].

      log4j: Setting property [append] to [true].

      log4j: Setting property [threshold] to [INFO].

      log4j: Setting property [datePattern] to ['.'yyyy-MM-dd].

      log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"

      log4j: Setting property [conversionPattern] to [%d %-5p [%t] [%c] %m%n].

      log4j: Setting property [acceptOnMatch] to [true].

      log4j: Setting property [deployURL] to [xxxxx.esb].

      log4j: Adding filter of type [class org.jboss.logging.filter.TCLMCFilter] to appender named [xxxxx].

      log4j: Adding filter of type [class org.apache.log4j.varia.DenyAllFilter] to appender named [xxxxx].

      log4j: setFile called: /xxxxx/jboss/outer/server/default/log/xxxxx.log, true

      log4j: setFile ended

      log4j: Appender [xxxxx] to be rolled at midnight.

      log4j: Adding appender named [xxxxx] to category [root].

      12:41:09,592 ERROR [AbstractKernelController] Error installing to Create: name=jboss.system:service=Logging,type=Log4jService state=Configured mode=Manual requiredState=Create

      java.lang.ClassCircularityError: org/jboss/classloading/plugins/vfs/VFSResourceVisitor

                at org.jboss.deployers.vfs.plugins.classloader.VFSDeploymentClassLoaderPolicyModule.visit(VFSDeploymentClassLoaderPolicyModule.java:160)

                at org.jboss.logging.filter.TCLMCFilter.matchClassLoader(TCLMCFilter.java:44)

                at org.jboss.logging.filter.AbstractTCLFilter.isMatchingTCL(AbstractTCLFilter.java:118)

                at org.jboss.logging.filter.AbstractTCLFilter.decide(AbstractTCLFilter.java:92)

                at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:223)

                at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65)

                at org.apache.log4j.Category.callAppenders(Category.java:203)

                at org.apache.log4j.Category.forcedLog(Category.java:388)

                at org.apache.log4j.Category.log(Category.java:853)

                at org.jboss.logging.log4j.Log4jLoggerPlugin.debug(Log4jLoggerPlugin.java:145)

                at org.jboss.logging.Logger.debug(Logger.java:228)

                at org.jboss.logging.Log4jService.installSystemAdapters(Log4jService.java:441)

                at org.jboss.logging.Log4jService.access$500(Log4jService.java:72)

                at org.jboss.logging.Log4jService$URLWatchTimerTask.reconfigure(Log4jService.java:710)

                at org.jboss.logging.Log4jService$URLWatchTimerTask.run(Log4jService.java:636)

                at org.jboss.logging.Log4jService.setup(Log4jService.java:492)

                at org.jboss.logging.Log4jService.createService(Log4jService.java:528)

                at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:344)

                at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:320)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)

                at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)

                at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)

                at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)

                at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)

                at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)

                at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)

                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)

                at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:189)

                at $Proxy38.create(Unknown Source)

                at org.jboss.system.microcontainer.CreateDestroyLifecycleAction.installAction(CreateDestroyLifecycleAction.java:42)

                at org.jboss.system.microcontainer.CreateDestroyLifecycleAction.installAction(CreateDestroyLifecycleAction.java:37)

                at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)

                at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)

                at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)

                at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

                at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)

                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

                at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

                at org.jboss.system.ServiceController.doChange(ServiceController.java:688)

                at org.jboss.system.ServiceController.create(ServiceController.java:422)

                at org.jboss.system.ServiceController.create(ServiceController.java:387)

                at org.jboss.system.deployers.ServiceDeployer.create(ServiceDeployer.java:158)

                at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:96)

                at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)

                at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)

                at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)

                at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)

                at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)

                at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)

                at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)

                at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)

                at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

                at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

                at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)

                at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)

                at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)

                at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)

                at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)

                at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)

                at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

                at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

                at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

                at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

                at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)

                at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)

                at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)

                at org.jboss.Main.boot(Main.java:221)

                at org.jboss.Main$1.run(Main.java:556)

                at java.lang.Thread.run(Thread.java:680)

       

      Setting property to DEBUG and JBoss boots alright. But then I'm not able to set threshold to TRACE for an appender during runtime. BUT.... if I during runtime changes ROOT level from DEBUG to TRACE, and sets threshold to TRACE for an appender, everything is fine. Until I reboot JBoss when same errors appears.

       

      So it seems that I cant have -Djboss.server.log.threshold=TRACE during boot but it is ok later on!?

       

      Bug or feature or what am I doing wrong

       

      /L