title: Is there an adapter for log4j2 to work over slf4j?
body: <p>I have a third party library (elasticsearch 5.x) which uses log4j2. My application uses slf4j. Is there an adapter for version 2 of log4j, similar to the version 1 adapter (log4j-over-slf4j)?</p>
  
  <p>Just to clarify: I don't want to actually use log4j or log4j2 as the actual implementation (binding). I use logback for that. So I need a log4j2 to slf4j adapter, not an slf4j binding.</p>
  
  <p>I should also mention that I have found and tried this library (in 2.0-beta version):
  <a href="https://logging.apache.org/log4j/2.0/log4j-to-slf4j/index.html" rel="noreferrer">https://logging.apache.org/log4j/2.0/log4j-to-slf4j/index.html</a>
  but it gives me this error:</p>
  
  <pre><code>Caused by: java.lang.AbstractMethodError: org.apache.logging.slf4j.SLF4JLoggerContextFactory.getContext(Ljava/lang/String;Ljava/lang/ClassLoader;Ljava/lang/Object;Z)Lorg/apache/logging/log4j/spi/LoggerContext;
  at org.apache.logging.log4j.LogManager.getContext(LogManager.java:175)
  at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:426)
  at org.elasticsearch.common.logging.ESLoggerFactory.getLogger(ESLoggerFactory.java:49)
  at org.elasticsearch.common.logging.Loggers.getLogger(Loggers.java:105)
  at org.elasticsearch.common.logging.Loggers.getLogger(Loggers.java:72)
  at org.elasticsearch.common.component.AbstractComponent.&lt;init&gt;(AbstractComponent.java:37)
  at org.elasticsearch.plugins.PluginsService.&lt;init&gt;(PluginsService.java:98)
  at org.elasticsearch.client.transport.TransportClient.newPluginService(TransportClient.java:99)
  at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:124)
  at org.elasticsearch.client.transport.TransportClient.&lt;init&gt;(TransportClient.java:258)
  at org.elasticsearch.transport.client.PreBuiltTransportClient.&lt;init&gt;(PreBuiltTransportClient.java:125)
  at org.elasticsearch.transport.client.PreBuiltTransportClient.&lt;init&gt;(PreBuiltTransportClient.java:111)
  at org.elasticsearch.transport.client.PreBuiltTransportClient.&lt;init&gt;(PreBuiltTransportClient.java:101)
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT</strong>: Ok.. so I guess I was just blind yesterday and I was only seeing the beta version of this library. Therefore the answer is that there is such as adapter and it is here:</p>
  
  <p><a href="https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-to-slf4j" rel="noreferrer">https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-to-slf4j</a> <a href="https://logging.apache.org/log4j/2.0/log4j-to-slf4j/index.html" rel="noreferrer">https://logging.apache.org/log4j/2.0/log4j-to-slf4j/index.html</a></p>
  
  <p>The latest version currently is 2.8.2</p>