How to hide output from es server


#1

Hi all,
How can I hide output printed in java client when connecting to ES server?


(David Pilato) #2

Which output? What do you mean?


#3

When connecting using TransportClient I get this kind of output..

CODE = TransportClient.builder().settings(Settings.builder() .... build().addTransportAddress(IP);

OUTPUT =

15:34:34.576 [main] INFO  org.elasticsearch.plugins - [mynode_node] loaded [], sites []
15:34:34.606 [main] DEBUG org.elasticsearch.threadpool - [mynode_node] creating thread_pool [force_merge], type [fixed], size [1], queue_size [null]
.....
.....

(David Pilato) #4

Change the logger settings.
You probably added a logger to your project, don't you?

So change org.elasticsearch to ERROR for example.


#5

Thanks.Let me try that.


#6

I have tried setting the error level of the root logger.But still get the the same logging output.

Log4jESLoggerFactory.getRootLogger().setLevel("ERROR");

But the problem is setLevel( ) function seems not setting the error level.in fact it's an empty method.
Am I missing something ?


(David Pilato) #7

Don't you have a log4.properties file or similar in your classpath?


(system) #8