How do i enable logging for elasticsearch java client

I built this standalone Java application that is connecting to
elasticSearch using Transport client on my local machine. I am trying to
figure out how to enable logging in it (This is to help me debug a wiered
streamcorrupexception that i am getting in my production cluster) but not
able to get it working. Can some one help

This is how my log4j.xml looks like log4j.xml and
this is how my pom.xml file for application looks like pom.xml. My
java client does create simple TransportClient and executes match all query
on it, the query is working ok. But i dont see much logs being created. I
also tried setting --Des.logger.level and passing the -Dlog4j.configuration=
file:////Users/sunil/temp/log4j.xml

[2015-Mar-13 06:56:41:437] DEBUG [Robert Bruce Banner]
node_sampler_interval[5s]
[2015-Mar-13 06:56:41:437] DEBUG [Robert Bruce Banner]
node_sampler_interval[5s]
[2015-Mar-13 06:56:41:500] DEBUG [Robert Bruce Banner] adding address
[[#transport#-1][sunil.local][inet[localhost/127.0.0.1:9300]]]
[2015-Mar-13 06:56:41:500] DEBUG [Robert Bruce Banner] adding address
[[#transport#-1][sunil.local][inet[localhost/127.0.0.1:9300]]]

but no luck so far

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/4cdfbc5d-6e79-4639-adef-5d7534f5e08c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

So i found out one way of enabling logs by hardcoding following in my
application

import org.elasticsearch.common.logging.ESLoggerFactory;

ESLoggerFactory.getRootLogger().setLevel("TRACE");

Now i am able to see some log being generated.

Sunil

On Friday, March 13, 2015 at 7:27:49 AM UTC-7, Sunil Patil wrote:

I built this standalone Java application that is connecting to
elasticSearch using Transport client on my local machine. I am trying to
figure out how to enable logging in it (This is to help me debug a wiered
streamcorrupexception that i am getting in my production cluster) but not
able to get it working. Can some one help

This is how my log4j.xml looks like log4j.xml and this
is how my pom.xml file for application looks like pom.xml. My java
client does create simple TransportClient and executes match all query on
it, the query is working ok. But i dont see much logs being created. I also
tried setting --Des.logger.level and passing the -Dlog4j.configuration=
file:////Users/sunil/temp/log4j.xml

[2015-Mar-13 06:56:41:437] DEBUG [Robert Bruce Banner]
node_sampler_interval[5s]
[2015-Mar-13 06:56:41:437] DEBUG [Robert Bruce Banner]
node_sampler_interval[5s]
[2015-Mar-13 06:56:41:500] DEBUG [Robert Bruce Banner] adding address
[[#transport#-1][sunil.local][inet[localhost/127.0.0.1:9300]]]
[2015-Mar-13 06:56:41:500] DEBUG [Robert Bruce Banner] adding address
[[#transport#-1][sunil.local][inet[localhost/127.0.0.1:9300]]]

but no luck so far

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/6b2a9449-9d72-405d-bf6b-6429d3f33043%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.