title: Using log4j2 with slf4j: java.lang.StackOverflowError
body: <p>So I have tried following <a href="https://stackoverflow.com/questions/25386651/slf4j-log4j2-maven-setup-query">this</a> (non-maven implementation) and requirements in their <a href="https://logging.apache.org/log4j/2.0/log4j-slf4j-impl/index.html" rel="noreferrer">web site</a> for adding slf4j to log4j. and tried using this code </p>
  
  <pre><code>public static void main(String[] args) {
          Logger logger = LoggerFactory.getLogger(Main.class);
          logger.info("test");
      }
  </code></pre>
  
  <p>and added the following to my library </p>
  
  <ul>
  <li>log4j-api-2.3.jar</li>
  <li>log4j-core-2.3.jar</li>
  <li>log4j-sl4j-impl-2.3.jar</li>
  <li>log4j-to-sl4j-2.3.jar</li>
  <li>slf4j-api-1.7.12.jar</li>
  </ul>
  
  <p>when I try running it I get the following error</p>
  
  <pre><code>Exception in thread "main" java.lang.StackOverflowError
      at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
      at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:964)
      at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:40)
      at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
      at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
      at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
      at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:284)
      at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:41)
      at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:37)
      at org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(Log4jLoggerFactory.java:29)
      at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
      at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)
      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:284)...
  </code></pre>
  
  <p>Any idea where I am going wrong?</p>