2 Replies Latest reply on Sep 16, 2016 7:28 AM by Jay Shah

    JBOSS eap6.3 logging config from log4j.xml not working in EAR, but working in WAR

    Rajasekhar Palle Newbie

      Hi,

       

      I have custom logging configurations defined in log4j.xml, and this file is placed in one of jar file ex: admin.jar.

      Put this jar file WAR archive ex: MyApp.war\WEB-INF\lib\admin.jar, and deployed in JBOSS eap-6.3 logging working fine, but when put WAR in EAR archive like MyAppPortal.ear\MyApp.war

      custom logging not working, JBOSS not creating configured application log files in log4j.xml.

       

      JBOSS and My app configurations as below.

       

      Set system property in standalone.xml file

      <property name="org.jboss.as.logging.per-deployment" value="false"/>

       

       

      Put below jboss-deployment-structure.xml file in MyApp.war\WEB-INF\ in WAR archive and MyAppPortal.ear\META-INF\ in EAR archive.

       

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

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">

        <deployment>

          <exclude-subsystems>

                <subsystem name="ejb3" />

                <subsystem name="jpa" />

                <subsystem name="jaxrs" />

          </exclude-subsystems>

       

          <exclusions>

              <module name="org.apache.commons.logging"/>

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

              <module name="org.slf4j"/>

          </exclusions>

        </deployment>

      </jboss-deployment-structure>


      if I deploy  WAR file in JBOSS server, custom app log file is created, but if deploy EAR file custom app log file not created.

      Please help me with this, is any other configurations required?