title: The WAR in my EAR doesn't load log4j2 properly but the JAR does
body: <p>I have this skinny-war EAR file. It is supposed to be contained in a WildFly 8.2.0.Final application server.</p>
  
  <pre><code>- lib
    - log4j-api-2.1.jar
    - log4j-core-2.1.jar
  - META-INF
    - application.xml
    - jboss-app.xml
    - log4j2.xml
    - MANIFEST.MF
  - my-ejb.jar
  - my-web.war (skinny war)
    - META-INF
      - MANIFEST.MF
    - WEB-INF
      - classes
        - ...
      - lib (empty since skinny war)
    - index.html
  </code></pre>
  
  <p>When I first start logging from <code>my-web.war</code>, I keep getting this message: <code>2015-03-04 11:04:22,806 ERROR [stderr] (default task-23) ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...</code> and no message is added to my log file.</p>
  
  <p>However when I start logging from <code>my-ejb.jar</code>, I have no issue at all and the consequent logging from <code>my-web.war</code> is working fine as well.</p>
  
  <p>How to have log4j2 properly used/configured in my EAR file so that I don't have to care that my ejb file is called first?</p>
  
  <p>Files, as requested:</p>
  
  <p>my-ejb.jar/META-INF/MANIFEST.MF:</p>
  
  <pre><code>Manifest-Version: 1.0
  Archiver-Version: Plexus Archiver
  Built-By: Olivier
  Class-Path: lib/log4j-api-2.1.jar lib/guava-18.0.jar lib/log4j-core-2.
   1.jar lib/log4j-web-2.1.jar
  Created-By: Apache Maven 3.2.3
  Build-Jdk: 1.8.0_25
  </code></pre>
  
  <p>my-web.war/META-INF/MANIFEST.MF</p>
  
  <pre><code>Manifest-Version: 1.0
  Archiver-Version: Plexus Archiver
  Built-By: Olivier
  Class-Path: lib/log4j-api-2.1.jar lib/guava-18.0.jar lib/log4j-core-2.
   1.jar lib/log4j-web-2.1.jar
  Created-By: Apache Maven 3.2.3
  Build-Jdk: 1.8.0_25
  </code></pre>