Elasticsearch v5.0.0: No log4j2 configuration file found

I'm using elasticsearch(v5.0.0) in java application. Everything is good except the console print an error message:

ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.

I need to new a Log4j2.xml or other files?
This is my pom.xml:

<dependencies>
        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>5.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>transport</artifactId>
            <version>5.0.0</version>
        </dependency>

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>2.6.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.6.2</version>
        </dependency>
    </dependencies>

yes, you need to add a log4j2 configuration file (log4j2.xml) to your classpath.

I don't know put this file in which directory. And, what is the content of log4j2.xml? Thanks... @ywelsch

If you use maven, the file can for example be put under src/main/resources.

Regarding content of log4j2.xml, best have a look at the official docs:

https://logging.apache.org/log4j/2.x/manual/configuration.html

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.