ES 6.4: Java RestClient and log4j2


(Ganesh) #1

src/main/resources/log4j2.xml

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="info" monitorInterval="60">
	<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="warn"/>
        <Logger name="org.apache" level="warn" />
	     <Root level="info">
		    <AppenderRef ref="Console" />
	     </Root>
	</Loggers>
</Configuration>

Console output

Despite setting log level to warn/error, I keep getting these DEBUG messages. This is impacting the performance. This log4j2.xml is corrected loaded as my Class logger that uses it works fine.

08:42:07.197 [main] DEBUG org.apache.http.impl.nio.client.MainClientExec - [exchange: 1] start execution
08:42:07.209 [main] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: default
08:42:07.224 [main] DEBUG org.apache.http.client.protocol.RequestAuthCache - Re-using cached 'basic' auth scheme for http://xxx.uk.db.com:9200
08:42:07.224 [main] DEBUG org.apache.http.client.protocol.RequestAuthCache - No credentials for preemptive authentication
08:42:07.224 [main] DEBUG org.apache.http.impl.nio.client.InternalHttpAsyncClient - [exchange: 1] Request connection for {}->http://xxx.uk.db.com:9200
08:42:07.226 [main] DEBUG org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager - Connection request: [route: {}->http://xxx.uk.db.com:9200][total kept alive: 0; route allocated: 0 of 10; total allocated: 0 of 30]
08:42:07.252 [I/O dispatcher 1] DEBUG org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager - Connection leased: [id: http-outgoing-0]

(system) #2

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