How to disable debug logging in http componentenets?
09:23:22.145 [main] DEBUG oahcprotocol.RequestAddCookies - CookieSpec selected: default 09:23:22.145 [main] DEBUG oahcprotocol.RequestAuthCache - Auth cache not set in the context 09:23:22.145 [main] DEBUG oahicPoolingHttpClientConnectionManager - Connection request: [route: {}->http://example.org:80][total kept alive: 1; route allocated: 1 of 100; total allocated: 1 of 200] 09:23:22.145 [main] DEBUG oahicPoolingHttpClientConnectionManager - Connection leased: [id: 0][route: {}->http://diagnostics-uat.corp.apple.com:80][total kept alive: 0; route allocated: 1 of 100; total allocated: 1 of 200] 09:23:22.145 [main] DEBUG oahimpl.execchain.MainClientExec - Executing request POST /evt/detect HTTP/1.1 09:23:22.145 [main] DEBUG oahimpl.execchain.MainClientExec - Target auth state: UNCHALLENGED 09:23:22.145 [main] DEBUG oahimpl.execchain.MainClientExec - Proxy auth state: UNCHALLENGED 09:23:22.145 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> POST /evt/detect HTTP/1.1 09:23:22.145 [main] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Length: 92
I tried the code based solution:
static { System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog"); System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http", "warn"); } public static void main(String[] args) throws Exception {
And this is log4j.properties
log4j.rootLogger=INFO, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%c] %m%n log4j.logger.org.apache.http=WARN log4j.logger.org.apache.http.wire=WARN
But not one of them worked. Help is appreciated, thanks!
source share