# HighLevelRestClient log4j configuration

**URL:** <https://discuss.elastic.co/t/highlevelrestclient-log4j-configuration/128577>\
**Category:** Elasticsearch\
**Created:** [April 18, 2018, 4:12pm UTC](https://discuss.elastic.co/t/highlevelrestclient-log4j-configuration/128577 "2018-04-18T16:12:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![seibelj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seibelj/32/35900_2.png) [@seibelj](https://discuss.elastic.co/u/seibelj)\
**Post date:** [April 18, 2018, 4:12pm UTC](https://discuss.elastic.co/t/highlevelrestclient-log4j-configuration/128577/1 "2018-04-18T16:12:09Z")

</div>

Hi. New to Elasticsearch and have a question about logging in the HighLevelRestClient.

I wrote a java client that uses the Rest Client but everytime I crank it up to insert records into Elasticsearch I get the following error:

Initialize RestHighLevelClient [localhost] port [9200]  
ERROR StatusLogger 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.

The logging then defaults to 'debug' and I get lots of logging output. I would like to be able to change the log level.  
I have logging in my own code and here is the relevant log4j configuration:

Here are the basics:

On version: elasticsearch-6.2.3  
Maven/Rest version build:

 org.elasticsearch.client elasticsearch-rest-high-level-client 6.2.3 

Does anyone know how to change the log level in the HighLevelRestClient code?

---

<div class="post-metadata">

**Author:** ![seibelj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seibelj/32/35900_2.png) [@seibelj](https://discuss.elastic.co/u/seibelj)\
**Post date:** [April 18, 2018, 4:13pm UTC](https://discuss.elastic.co/t/highlevelrestclient-log4j-configuration/128577/2 "2018-04-18T16:13:45Z")

</div>

The markup hide this:  
logger name="org.elasticsearch"  
level value="FATAL"  
logger

---

<div class="post-metadata">

**Author:** ![seibelj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seibelj/32/35900_2.png) [@seibelj](https://discuss.elastic.co/u/seibelj)\
**Post date:** [April 19, 2018, 4:12pm UTC](https://discuss.elastic.co/t/highlevelrestclient-log4j-configuration/128577/3 "2018-04-19T16:12:13Z")

</div>

After messing around, I've learned that the RestClient picks up the log level in my defined Log4j file. Doh.

---

<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:** [May 17, 2018, 4:12pm UTC](https://discuss.elastic.co/t/highlevelrestclient-log4j-configuration/128577/4 "2018-05-17T16:12:43Z")

</div>

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