<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    As 7.2 Log4j Logging
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/bill.rosenberg">Bill Rosenberg</a> in <i>JBoss AS 7 Development</i> - <a href="https://community.jboss.org/message/823536#823536">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Logging seemed to work fine when i was using AS 7.1 with log4j libs and code, now when using 7.2, i do not see the expected logging using log4j.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I follow the migration guide:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="margin-bottom: .0001pt;"><strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans-Bold; color: #a80000;">Procedure 3.5. Configure JBoss Enterprise Application Platform 6 to use a log4 j.properties</span></strong></p><p style="margin-bottom: .0001pt;"><strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans-Bold; color: #a80000;">or log4 j.xml file</span></strong></p><ol style="list-style-type: decimal;"><li><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">1. Create a </span><strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationMono-Bold; color: black;">jboss-deploym ent-structure.xm l </span></strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">with the following content:</span></li></ol><p style="margin-bottom: .0001pt;"><span lang="EN" style="font-size: 10.0pt; font-family: LiberationMono; color: #002f5d;">&lt;jboss-deploym ent-structure&gt;</span></p><p style="margin-bottom: .0001pt;"><span lang="EN" style="font-size: 10.0pt; font-family: LiberationMono; color: #002f5d;">&lt;deploym ent&gt;</span></p><p style="margin-bottom: .0001pt;"><span lang="EN" style="font-size: 10.0pt; font-family: LiberationMono; color: fuchsia;">&lt;!-- Exclusions allow you to prevent the server from autom atically</span></p><p style="margin-bottom: .0001pt;"><span lang="EN" style="font-size: 10.0pt; font-family: LiberationMono; color: fuchsia;">adding som e dependencies --&gt;</span></p><p style="margin-bottom: .0001pt;"><span lang="EN" style="font-size: 10.0pt; font-family: LiberationMono; color: #002f5d;">&lt;exclusions&gt;</span></p><p style="margin-bottom: .0001pt;"><span lang="EN" style="font-size: 10.0pt; font-family: LiberationMono; color: #002f5d;">&lt;m odule </span><span lang="EN" style="font-size: 10.0pt; font-family: LiberationMono; color: #b13060;">nam e=</span><span lang="EN" style="font-size: 10.0pt; font-family: LiberationMono; color: #5c3566;">"org.apache.log4j" </span><span lang="EN" style="font-size: 10.0pt; font-family: LiberationMono; color: #002f5d;">/&gt;</span></p><p style="margin-bottom: .0001pt;"><span lang="EN" style="font-size: 10.0pt; font-family: LiberationMono; color: #002f5d;">&lt;/exclusions&gt;</span></p><p style="margin-bottom: .0001pt;"><span lang="EN" style="font-size: 10.0pt; font-family: LiberationMono; color: #002f5d;">&lt;/deploym ent&gt;</span></p><p style="margin-bottom: .0001pt;"><span lang="EN" style="font-size: 10.0pt; font-family: LiberationMono; color: #002f5d;">&lt;/jboss-deploym ent-structure&gt;</span></p><ol style="list-style-type: decimal;"><li><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">2. Place the </span><strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationMono-Bold; color: black;">jboss-deploym ent-structure.xm l </span></strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">file in either the </span><strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationMono-Bold; color: black;">MET A-INF/ </span></strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">directory or the</span></li></ol><p style="margin-bottom: .0001pt;"><strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationMono-Bold; color: black;">WEB-INF/ </span></strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">directory if you are deploying a WAR, or in the </span><strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationMono-Bold; color: black;">MET A-INF/ </span></strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">directory if you are</span></p><p style="margin-bottom: .0001pt;"><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">deploying an EAR.</span></p><ol style="list-style-type: decimal;"><li><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">3. Include the </span><strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationMono-Bold; color: black;">log4 j.properties </span></strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">or </span><strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationMono-Bold; color: black;">log4 j.xm l </span></strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">file in the </span><strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationMono-Bold; color: black;">lib/ </span></strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">directory in your deployment.</span></li><li><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">4. Start the JBoss Enterprise Application Platform 6 server with the following runtime argument to</span></li></ol><p style="margin-bottom: .0001pt;"><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">prevent a </span><strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationMono-Bold; color: black;">ClassCastException </span></strong><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">from appearing in the console when you deploy the application:</span></p><p style="margin-bottom: .0001pt;"><span lang="EN" style="font-size: 10.0pt; font-family: LiberationMono; color: black;">-Dorg.jboss.as.logging.per-deploym ent=false</span></p><ol style="list-style-type: decimal;"><li><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">5. Deploy your application.</span></li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;">And then i get an exception that log4j classes cannot be found, which i would expect if i exclude log4j from the deployment.<br/></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>12:41:29,192 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.subunit."LightSpeed.ear"."LightSpeedEJB.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."LightSpeed.ear"."LightSpeedEJB.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "LightSpeedEJB.jar" of deployment "LightSpeed.ear"</p><p>&#160;&#160;&#160; at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]</p><p>&#160;&#160;&#160; at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]</p><p>&#160;&#160;&#160; at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]</p><p>&#160;&#160;&#160; at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]</p><p>&#160;&#160;&#160; at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]</p><p>&#160;&#160;&#160; at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]</p><p><span style="color: #ff0000;"><strong>Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Priority</strong></span></p><p>&#160;&#160;&#160; at com.lightspeed.rdp.ejb.RateDynamicStatusBean.&lt;clinit&gt;(RateDynamicStatusBean.java:67)</p><p>&#160;&#160;&#160; at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_21]</p><p>&#160;&#160;&#160; at java.lang.Class.forName(Class.java:266) [rt.jar:1.7.0_21]</p><p>&#160;&#160;&#160; at org.jboss.invocation.proxy.AbstractProxyFactory.afterClassLoad(AbstractProxyFactory.java:94)</p><p>&#160;&#160;&#160; at org.jboss.invocation.proxy.AbstractClassFactory.defineClass(AbstractClassFactory.java:166)</p><p>&#160;&#160;&#160; at org.jboss.invocation.proxy.AbstractProxyFactory.getCachedMethods(AbstractProxyFactory.java:145)</p><p>&#160;&#160;&#160; at org.jboss.as.ejb3.component.stateless.StatelessComponentDescription$3.configure(StatelessComponentDescription.java:150)</p><p>&#160;&#160;&#160; at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:929)</p><p>&#160;&#160;&#160; at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:80)</p><p>&#160;&#160;&#160; at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]</p><p>&#160;&#160;&#160; ... 5 more</p><p>Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Priority from [Module "deployment.LightSpeed.ear:main" from Service Module Loader]</p><p>&#160;&#160;&#160; at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]</p><p>&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]</p><p>&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]</p><p>&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]</p><p>&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]</p><p>&#160;&#160;&#160; ... 15 more</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span lang="EN" style="font-size: 10.5pt; font-family: LiberationSans; color: black;"><br/></span></p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/823536#823536">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss AS 7 Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>