# How to properly configure Log4J 2?

**URL:** <https://discuss.elastic.co/t/how-to-properly-configure-log4j-2/100311>\
**Category:** Elasticsearch\
**Created:** [September 13, 2017, 8:28am UTC](https://discuss.elastic.co/t/how-to-properly-configure-log4j-2/100311 "2017-09-13T08:28:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jenia](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@Jenia](https://discuss.elastic.co/u/Jenia)\
**Post date:** [September 13, 2017, 8:28am UTC](https://discuss.elastic.co/t/how-to-properly-configure-log4j-2/100311/1 "2017-09-13T08:28:57Z")

</div>

Hi,

I’m trying to configure Log4J2 in Java project after getting this message:

“No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging.”

As I understood, I should add log4j2.properties to the classpath.

But, this file should also be located in Elastic’s config folder as mentioned here:

[https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html#logging](https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html#logging)

Should I manage this file in two location? One location is Elastic node and the second one in my Java project?

I think I’m missing something here, your help will be highly appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 13, 2017, 8:59am UTC](https://discuss.elastic.co/t/how-to-properly-configure-log4j-2/100311/2 "2017-09-13T08:59:25Z")

</div>

Are you using the TransportClient here?

May be read this: [https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/\_log4j\_2\_logger.html](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/_log4j_2_logger.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:** [October 11, 2017, 8:59am UTC](https://discuss.elastic.co/t/how-to-properly-configure-log4j-2/100311/3 "2017-10-11T08:59:39Z")

</div>

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