title: Log4j2 api cannot find Log4j2 core in OSGi environment
body: <p>I'm trying to use log4j2 OSGi bundles, but it seems log4j2 api cannot find log4j2 core in an OSGi environment. I'm continuously getting the following exception :</p>
  
  <pre><code>ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console
  </code></pre>
  
  <p>I found the same exception discussed in few places but still I could not figure out this issue. Isuspect I'm getting this issue because log4j2 api cannot find the log4j-provider.properties inside the META-INF directory of log4j2 core. 
  Is there any clue why I'm getting this exception and how can I correct the issue ? 
  (If anybody has correct pom file for adding log4j dependencies and bundling please share it with me)</p>
  
  <p>These are the dependencies I have used</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j-api&lt;/artifactId&gt;
          &lt;version&gt;2.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j-core&lt;/artifactId&gt;
          &lt;version&gt;2.2&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>I use apache felix as the bundle plugin. This error occures because resources inside the META-INF of log4j2-core specially the log4j-providoer.properties file is not visible to log4j api.</p>
  
  <p>Thanks!</p>