5 Replies Latest reply on Nov 29, 2012 4:53 AM by Stephan Pelikan

    Per-deployment logging configuration does sometimes not work

    Stephan Pelikan Newbie

      Hello,

       

      I use a per-deployment logging configuration as provided by James Perkins (https://issues.jboss.org/browse/AS7-514). I use a JBoss 7.1.2 in an cluster-environment and I have different cluster-groups (each group is a pair of servers on different hardware-servers).

       

      The effect we see is, that the log4j-config in a specific deployment deployed to a servergroup sometimes fully and sometimes just partitionally applies. Another effect is that some log4j-rules seems never to apply. The ear itself deployes fine, only log4j-rules does not apply in a reproduceable way.

       

      This is my log4j.xml:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
      <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
      
         <appender name="APP" class="org.apache.log4j.DailyRollingFileAppender">
            <errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler"/>
            <param name="File" value="${jboss.server.log.dir}/application.log"/>
            <param name="Append" value="true"/>
            <param name="DatePattern" value="'.'yyyy-MM-dd"/>
            <layout class="org.apache.log4j.PatternLayout">
               <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n"/>
            </layout>
         </appender>
         
         <appender name="STAT" class="org.apache.log4j.DailyRollingFileAppender">
            <errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler"/>
            <param name="File" value="${jboss.server.log.dir}/statistic.log"/>
            <param name="Append" value="true"/>
            <param name="Threshold" value="INFO" />
            <param name="DatePattern" value="'.'yyyy-MM-dd"/>
            <layout class="org.apache.log4j.PatternLayout">
               <param name="ConversionPattern" value="%d;%m%n"/>
            </layout>
         </appender>
         
         <appender name="APA_ADDONS" class="org.apache.log4j.DailyRollingFileAppender">
            <errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler"/>
              <param name="File" value="${jboss.server.log.dir}/apaAddons.log"/>
              <param name="Append" value="true"/>    
              <param name="Threshold" value="INFO" />      
              <param name="DatePattern" value="'.'yyyy-MM-dd"/>
              <layout class="org.apache.log4j.PatternLayout">         
                      <param name="ConversionPattern" value="%d;%m%n"/>
              </layout>
         </appender>
            
         <logger name="org.apache">
            <level value="INFO"/>
         </logger>
         
         <logger name="javax.xml.bind">
            <level value="INFO"/>
         </logger>
         
         <logger name="at.apa">
            <level value="INFO"/>
         </logger>
      
         <logger name="at.apa.powersearch">
            <level value="WARN"/>
         </logger>
      
         <logger name="at.apa.pdfwlserver.aboauthorization">
            <level value="DEBUG"/>
         </logger>
         
         <logger name="at.apa.pdfwlserver.authorization">
            <level value="DEBUG"/>
         </logger>
      
         <logger name="freemarker">
            <level value="INFO"/>
         </logger>
      
         <logger name="javapns">
            <level value="INFO"/>
         </logger>
      
         <logger name="at.apa.pdfwlserver.Statistics">
            <appender-ref ref="STAT"/>
         </logger>
      
         <logger name="at.apa.pdfwlserver.logging.ApaAddonsLogger" additivity="false">
              <appender-ref ref="APA_ADDONS"/>
         </logger>
         
         <root>
            <priority value="DEBUG"/>
            <appender-ref ref="APP"/>
         </root>
         
      </log4j:configuration>
      

       

      I define three appenders. The APP-appender contains all. The other files contain only certain logging.

       

      First effect:

      The files of the STAT- and APA_ADDONS-appenders are not filled. All logs appear in the file of the APP-appender, including those which also should appear in the other appender's files. I see this (for instance) on server one of group A but on server two of the same group, the files of STAT- and APA_ADDONS-appenders are filled! It seems that the file of the APP-appender is filled always - only the other appenders have "crazy" behaviour.

       

      Second effect:

      I set the log-level of package "freemarker" and "javapns" to INFO. But this is ignored: I get also DEBUG-log-lines. I've tried different syntax but nothing helped.

       

      I played around since a couple of weeks but I don't find the reason for this. Last week I redeployed on ear many times and sometimes logging worked as configured and most of the time it doesn't. Maybe the way the log4j.xml is applied by https://issues.jboss.org/browse/AS7-514 does not work correctly?

       

      It didn't mention since now: I don't package log4j in my ear to avoid conflicts.

       

      Does any one have a suggestion have to handle this? I've tried to debug logging, but I only see that there is only one appender in the logger's chain but not why.

       

      Thanks,

      Stephan

        • 1. Re: Per-deployment logging configuration does sometimes not work
          James Perkins Master

          Could there possibly be another log4j configuration file that's being picked up? There is a JIRA (https://issues.jboss.org/browse/AS7-5422) to make the scanning more deterministic. You can see which file is being used by turning on trace logging for the logging subsystem.

           

          To turn on debug logging via CLI:

          /subsystem=logging/logger=org.jboss.as.logging:add(level=TRACE)
          
          /subsystem=logging/console-handler=CONSOLE:write-attribute(name=level,value=TRACE)
          

           

           

          Though after a bit of testing I don't think that's the issue. I don't see anything wrong with the configuration file. This could be a bug. I'll do some debugging as the deployment unit processor just uses the DOMConfigurator.

           

          If you need an immediate solution you might want to exclude the system version of log4j and include your own. You can get more information on this in the documentation.

           

          --

          James R. Perkins

          • 2. Re: Per-deployment logging configuration does sometimes not work
            Stephan Pelikan Newbie

            Thank you for your response. Ich tried it but it doesn't work.

             

            My ear now includes:

               lib/log4j.xml

               lib/log4j-1.2.16.jar

            and the jboss-deployment-structure.xml as shown in the documentation.

             

            Deploying gives me:

            15:52:38,548 ERROR [stderr] (MSC service thread 1-4) log4j:ERROR Could not create an Appender. Reported error follows.

            15:52:38,548 ERROR [stderr] (MSC service thread 1-4) java.lang.ClassCastException: org.apache.log4j.DailyRollingFileAppender cannot be cast to org.apache.log4j.Appender

            15:52:38,549 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:248)

            15:52:38,549 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)

            15:52:38,549 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)

            15:52:38,549 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)

            15:52:38,549 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:436)

            15:52:38,550 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:999)

            15:52:38,550 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:867)

            15:52:38,550 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:794)

            15:52:38,550 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.as.logging.LoggingConfigurationProcessor.deploy(LoggingConfigurationProcessor.java:111)

            15:52:38,551 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116)

            15:52:38,551 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

            15:52:38,551 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

            15:52:38,551 ERROR [stderr] (MSC service thread 1-4)    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

            15:52:38,552 ERROR [stderr] (MSC service thread 1-4)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

            15:52:38,552 ERROR [stderr] (MSC service thread 1-4)    at java.lang.Thread.run(Thread.java:662)

            15:52:38,553 ERROR [stderr] (MSC service thread 1-4) log4j:ERROR Could not create an Appender. Reported error follows.

            15:52:38,553 ERROR [stderr] (MSC service thread 1-4) java.lang.ClassCastException: org.apache.log4j.DailyRollingFileAppender cannot be cast to org.apache.log4j.Appender

            15:52:38,554 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:248)

            15:52:38,554 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)

            15:52:38,554 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)

            15:52:38,554 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)

            15:52:38,555 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:436)

            15:52:38,555 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:999)

            15:52:38,555 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:867)

            15:52:38,555 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:794)

            15:52:38,556 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.as.logging.LoggingConfigurationProcessor.deploy(LoggingConfigurationProcessor.java:111)

            15:52:38,556 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116)

            15:52:38,556 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

            15:52:38,556 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

            15:52:38,557 ERROR [stderr] (MSC service thread 1-4)    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

            15:52:38,557 ERROR [stderr] (MSC service thread 1-4)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

            15:52:38,557 ERROR [stderr] (MSC service thread 1-4)    at java.lang.Thread.run(Thread.java:662)

            15:52:38,558 ERROR [stderr] (MSC service thread 1-4) log4j:ERROR Could not create an Appender. Reported error follows.

            15:52:38,558 ERROR [stderr] (MSC service thread 1-4) java.lang.ClassCastException: org.apache.log4j.DailyRollingFileAppender cannot be cast to org.apache.log4j.Appender

            15:52:38,558 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:248)

            15:52:38,559 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)

            15:52:38,559 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)

            15:52:38,559 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)

            15:52:38,559 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:492)

            15:52:38,560 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1001)

            15:52:38,560 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:867)

            15:52:38,560 ERROR [stderr] (MSC service thread 1-4)    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:794)

            15:52:38,560 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.as.logging.LoggingConfigurationProcessor.deploy(LoggingConfigurationProcessor.java:111)

            15:52:38,560 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116)

            15:52:38,561 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

            15:52:38,561 ERROR [stderr] (MSC service thread 1-4)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

            15:52:38,561 ERROR [stderr] (MSC service thread 1-4)    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

            15:52:38,561 ERROR [stderr] (MSC service thread 1-4)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

            15:52:38,562 ERROR [stderr] (MSC service thread 1-4)    at java.lang.Thread.run(Thread.java:662)

            15:52:38,636 WARN  [org.jboss.modules] (MSC service thread 1-5) Failed to define class org.apache.log4j.Logger in Module "deployment.PDF-Whitelabel-Server-Ear-0.0.1-SNAPSHOT.ear:main" from Service Module Loader: java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/modules/ModuleClassLoader) previously initiated loading for a different type with name "org/apache/log4j/Logger"

                    at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.6.0_29]

                    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) [rt.jar:1.6.0_29]

                    at java.lang.ClassLoader.defineClass(ClassLoader.java:615) [rt.jar:1.6.0_29]

                    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [rt.jar:1.6.0_29]

                    at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327) [jboss-modules.jar:1.1.2.GA]

                    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391) [jboss-modules.jar:1.1.2.GA]

                    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243) [jboss-modules.jar:1.1.2.GA]

                    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73) [jboss-modules.jar:1.1.2.GA]

                    at org.jboss.modules.Module.loadModuleClass(Module.java:527) [jboss-modules.jar:1.1.2.GA]

                    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182) [jboss-modules.jar:1.1.2.GA]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.2.GA]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.2.GA]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.2.GA]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.2.GA]

                    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.2.GA]

                    at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.6.0_29]

                    at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) [rt.jar:1.6.0_29]

                    at java.lang.Class.getDeclaredMethods(Class.java:1791) [rt.jar:1.6.0_29]

                    at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:65) [jboss-as-server-7.1.2.Final.jar:7.1.2.Final]

                    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:68) [jboss-as-server-7.1.2.Final.jar:7.1.2.Final]

                    at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)

                    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:85)

                    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:70)

                    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55)

                    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.1.2.Final.jar:7.1.2.Final]

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_29]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_29]

                    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_29]

             

             

            15:52:38,640 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.deployment.subunit."PDF-Whitelabel-Server-Ear-0.0.1-SNAPSHOT.ear"."pdfWhitelabelServer.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."PDF-Whitelabel-Server-Ear-0.0.1-SNAPSHOT.ear"."pdfWhitelabelServer.jar".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of subdeployment "pdfWhitelabelServer.jar" of deployment "PDF-Whitelabel-Server-Ear-0.0.1-SNAPSHOT.ear"

                    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.1.2.Final.jar:7.1.2.Final]

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_29]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_29]

                    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_29]

            Caused by: java.lang.RuntimeException: JBAS018757: Error getting reflective information for class at.apa.apns.service.PushNotificationMDB with ClassLoader ModuleClassLoader for Module "deployment.PDF-Whitelabel-Server-Ear-0.0.1-SNAPSHOT.ear:main" from Service Module Loader

                    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:72) [jboss-as-server-7.1.2.Final.jar:7.1.2.Final]

                    at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)

                    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:85)

                    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:70)

                    at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55)

                    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.1.2.Final.jar:7.1.2.Final]

                    ... 5 more

            Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Logger

                    at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.6.0_29]

                    at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) [rt.jar:1.6.0_29]

                    at java.lang.Class.getDeclaredMethods(Class.java:1791) [rt.jar:1.6.0_29]

                    at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:65) [jboss-as-server-7.1.2.Final.jar:7.1.2.Final]

                    at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:68) [jboss-as-server-7.1.2.Final.jar:7.1.2.Final]

                    ... 10 more

            Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger from [Module "deployment.PDF-Whitelabel-Server-Ear-0.0.1-SNAPSHOT.ear:main" from Service Module Loader]

                    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.2.GA]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.2.GA]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.2.GA]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.2.GA]

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.2.GA]

                    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.2.GA]

                    ... 15 more

             

            If I understand this the class cannot be found because I excluded it explicitly. But why hasn't my lib/log4j.jar been used?

             

            Stephan

            • 3. Re: Per-deployment logging configuration does sometimes not work
              James Perkins Master

              Yeah, definitely looks like the servers log4j isn't being excluded. Double check where the jboss-deployment-structure.xml is located. It's the only thing I can think of that could cause the issue.

               

              --

              James R. Perkins

              • 4. Re: Per-deployment logging configuration does sometimes not work
                Jay SenSharma Master

                Try using the "EAR/META-INF/jboss-deployment-structure.xml" as following:

                 

                <?xml version="1.0" encoding="UTF-8"?>

                <jboss-deployment-structure>

                  <deployment>

                       <exclusions>

                            <module name="org.apache.log4j" />

                       </exclusions>

                  </deployment>

                       <sub-deployment name="Log4jDemo.war">

                           <exclusions>

                               <module name="org.apache.log4j" />

                           </exclusions>

                       </sub-deployment>

                </jboss-deployment-structure>

                 

                 

                I just added a corrected EAR in the ffollowing Git repo:  https://github.com/jaysensharma/MiddlewareMagicDemos/tree/master/EAR_Level_Log4jDemo

                 

                EAR can be downloaded for the following link:  https://github.com/jaysensharma/MiddlewareMagicDemos/raw/master/EAR_Level_Log4jDemo/build/Log4jBasedApp.ear

                 

                Make sure that you start the JBossAS 7.1.2 with the following system property:

                 

                ./standalone.sh -c standalone-full.xml  -Dorg.jboss.as.logging.per-deployment=false

                 

                 

                JIRA reference:

                [1]  https://issues.jboss.org/browse/AS7-514

                • 5. Re: Per-deployment logging configuration does sometimes not work
                  Stephan Pelikan Newbie

                  This did the trick. jboss-deployment-structure.xml was at the right place but the section for the war/ear was missing. The system-property "org.jboss.as.logging.per-deployment" doesn't seem to have any effect but I set it anyway.

                   

                  Thanks a lot to all!

                   

                  By-the-way: Now I see a lot of logging which was supressed before, so I proceed analysing of those things...