ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console

SDS picture SDS · Sep 4, 2014 · Viewed 9.7k times · Source

I've log4j-api v2.0.2 and log4j-core v2.0.2 in the pom.xml of a fragment project and trying to build a project thats OSGI compliant. I get the following message

 "ERROR StatusLogger Log4j2 could not find a logging implementation. 
    Please add log4j-core to the classpath. Using SimpleLogger to log to the
    console...".

log4j2.xml file is under src/main/resources folder. I printed the class path (System.getProperties()) and both the jar's are loaded in the classpath. Any pointers?

Answer

Remko Popma picture Remko Popma · Sep 5, 2014

I suspect this is a classloader issue with OSGi. Can you create a ticket for this on the log4j2 Jira issue tracker?