I have this nightmarish EAR file. It is assumed that it is contained in the application server WildFly 8.2.0.Final.
- 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
When I first start logging in my-web.war, I keep getting this message: 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...and no message is added to my log file.
However, when I start logging in my-ejb.jar, I have no problem at all, and the subsequent log out my-web.waralso works fine.
How to correctly use / configure log4j2 in my EAR file, so I don’t have to worry about the first ejb file being called first?
Files requested:
my-ejb.jar / META-INF / MANIFEST.MF:
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
my-web.war / META-INF / MANIFEST.MF
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