# Elasticsearch v5.0.0: No log4j2 configuration file found

**URL:** https://discuss.elastic.co/t/elasticsearch-v5-0-0-no-log4j2-configuration-file-found/65476
**Category:** Elasticsearch
**Created:** [November 9, 2016, 11:46am UTC](https://discuss.elastic.co/t/elasticsearch-v5-0-0-no-log4j2-configuration-file-found/65476 "2016-11-09T11:46:54Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kevinZ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kevinz/32/13242_2.png) [@kevinZ](https://discuss.elastic.co/u/kevinZ)
#### Post date: [November 9, 2016, 11:46am UTC](https://discuss.elastic.co/t/elasticsearch-v5-0-0-no-log4j2-configuration-file-found/65476/1 "2016-11-09T11:46:54Z")

</div>

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

```auto
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`:

```auto
<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>

```

---

<div class="post-metadata">

### Author: ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)
#### Post date: [November 9, 2016, 12:11pm UTC](https://discuss.elastic.co/t/elasticsearch-v5-0-0-no-log4j2-configuration-file-found/65476/2 "2016-11-09T12:11:30Z")

</div>

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

---

<div class="post-metadata">

### Author: ![kevinZ](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kevinz/32/13242_2.png) [@kevinZ](https://discuss.elastic.co/u/kevinZ)
#### Post date: [November 9, 2016, 12:53pm UTC](https://discuss.elastic.co/t/elasticsearch-v5-0-0-no-log4j2-configuration-file-found/65476/3 "2016-11-09T12:53:20Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)
#### Post date: [November 9, 2016, 1:11pm UTC](https://discuss.elastic.co/t/elasticsearch-v5-0-0-no-log4j2-configuration-file-found/65476/4 "2016-11-09T13:11:59Z")

</div>

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](https://logging.apache.org/log4j/2.x/manual/configuration.html)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [December 7, 2016, 1:12pm UTC](https://discuss.elastic.co/t/elasticsearch-v5-0-0-no-log4j2-configuration-file-found/65476/5 "2016-12-07T13:12:02Z")

</div>

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