Zfs
(Trevor Dodds)
June 17, 2016, 3:09pm
1
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
Zfs
(Trevor Dodds)
June 17, 2016, 3:13pm
2
Turns out the below works
Log4jESLoggerFactory.getLogger("").setLevel("WARN");
dadoonet
(David Pilato)
June 17, 2016, 3:49pm
3
If you are using Log4J, you could also simply do that with some configuration.
Like add a log4j2.xml
in your classpath:
<?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