# Disable logging on the JAVA transport client

**URL:** <https://discuss.elastic.co/t/disable-logging-on-the-java-transport-client/53170>\
**Category:** Elasticsearch\
**Created:** [June 17, 2016, 3:09pm UTC](https://discuss.elastic.co/t/disable-logging-on-the-java-transport-client/53170 "2016-06-17T15:09:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zfs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zfs/32/13370_2.png) [@Zfs](https://discuss.elastic.co/u/Zfs)\
**Post date:** [June 17, 2016, 3:09pm UTC](https://discuss.elastic.co/t/disable-logging-on-the-java-transport-client/53170/1 "2016-06-17T15:09:17Z")

</div>

Hi,

I'm trying to disable logging on the JAVA client, so I don't have the below outputting.

INFO: [Stone] modules [], plugins [], sites []  
INFO: [Alchemy] modules [], plugins [], sites []

I've tried setting Log4jESLoggerFactory.getLogger("discovery").setLevel("WARN");

Is there a switch for this?

Thanks

---

<div class="post-metadata">

**Author:** ![Zfs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zfs/32/13370_2.png) [@Zfs](https://discuss.elastic.co/u/Zfs)\
**Post date:** [June 17, 2016, 3:13pm UTC](https://discuss.elastic.co/t/disable-logging-on-the-java-transport-client/53170/2 "2016-06-17T15:13:00Z")

</div>

Turns out the below works

```
Log4jESLoggerFactory.getLogger("").setLevel("WARN");
```

---

<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:** [June 17, 2016, 3:49pm UTC](https://discuss.elastic.co/t/disable-logging-on-the-java-transport-client/53170/3 "2016-06-17T15:49:23Z")

</div>

If you are using Log4J, you could also simply do that with some configuration.

Like add a `log4j2.xml` in your classpath:

```auto
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="info" monitorInterval="5">
	<Appenders>
		<Console name="Console" target="SYSTEM_OUT">
			<PatternLayout pattern="%d{HH:mm:ss.SSS} [%-5level] %C{1.} - %msg%n" />
		</Console>
	</Appenders>
	<Loggers>
        <Logger name="org.elasticsearch" level="error"/>
	<Root level="info">
		<AppenderRef ref="Console" />
	</Root>
	</Loggers>
</Configuration>

```

This is what I'm doing here: [https://github.com/dadoonet/legacy-search/blob/01-direct/src/main/resources/log4j2.xml](https://github.com/dadoonet/legacy-search/blob/01-direct/src/main/resources/log4j2.xml)

---

<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:** [July 5, 2017, 10:42pm UTC](https://discuss.elastic.co/t/disable-logging-on-the-java-transport-client/53170/4 "2017-07-05T22:42:42Z")

</div>


