I upgraded elasticsearch java client from 2.3 to 5.1.
And this error log continues to appear.
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
I'm using log4j2
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.7</version>
</dependency>
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console... I resolved it by excluding log4j-api from elasticsearch dependency, but on the other hand, I have got this error: Cause: java.lang.ClassNotFoundException: org.apache.logging.log4j.Logger
In dependency analyzer, I found that elasticsearch uses log4j-api 2.11.1 <dependency> <groupId>org.elasticsearch</groupId> <artifactId>elasticsearch</artifactId> <version>6.7.0</version> </dependency> ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath.
You need to also include Log4j 2 dependencies: And also provide a Log4j 2 configuration file in your classpath. For example, you can add in your src/main/resources project dir a log4j2.properties file like:
very late answer, however :) if you don't want to upgrade ES, just add following dependency to pom :
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>2.8.2</version>
</dependency>
that should fix it
Using newest log4j2
helped me.
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.11.1</version>
</dependency>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With