Я использую Selenium для автоматизации тестовых приложений с использованием TestNG Framework. Он вызывает WebDriver, который внутренне использует HTTPClient lib. В моем пути к классам есть несколько протоколов регистрации, а именно - slf4j & log4j.Отключить протоколирование сообщений для HttpClient
Я попробовал почти все, что написано здесь - Disable HttpClient logging как создать файл log4j.properties, commons-logging.properties файл, а затем добавить к classpath- SRC/Java/главный
Так что у меня 2 Вопросы -
- Как заставить HttpClient использовать конкретное протоколирование банку (как я не добавил протоколирования Завис о лесозаготовительных Кувшинах. Они автоматически загружаются как некоторые из других зависимостей могут быть внутренне с помощью этого.)
Как отключить нежелательные сообщения отладки HttpClient.
SLF4J: Путь к классу содержит несколько привязок SLF4J. SLF4J: Найдено привязка в [jar: файл:/C: /Users/~/.m2/repository/ch/qos/logback/logback-classic/1.0.7/logback-classic-1.0.7.jar!/Org /slf4j/impl/StaticLoggerBinder.class] SLF4J: Найдено привязку в [jar: файл:/C: /Users/~/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6 .1.jar! /org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Найдено привязку в [jar: файл:/C: /Users/~/.m2/repository/org/apache/activemq/activemq-all/ 5.6.0/activemq-all-5.6.0.jar! /org/slf4j/impl/StaticLoggerBinder.class] SLF4J: См. http://www.slf4j.org/codes.html#multiple_bindings для получения пояснений. SLF4J: Фактическое связывание типа [ch.qos.logback.classic.util.ContextSelectorStaticBinder] Начиная ChromeDriver (v2.9.248315) на порт 3052
18:27:00.726 [Forwarding newSession on session null to remote] DEBUG o.a.h.c.protocol.RequestAddCookies - CookieSpec selected: best-match 18:27:00.727 [Forwarding newSession on session null to remote] DEBUG o.a.h.c.protocol.RequestAuthCache - Auth cache not set in the context 18:27:00.727 [Forwarding newSession on session null to remote] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection request: [route: {}->http://localhost:3052][total kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000] 18:27:00.758 [Forwarding newSession on session null to remote] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection leased: [id: 0][route: {}->http://localhost:3052][total kept alive: 0; route allocated: 1 of 2000; total allocated: 1 of 2000] 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG o.a.h.impl.execchain.MainClientExec - Opening connection {}->http://localhost:3052 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG o.a.h.i.c.HttpClientConnectionOperator - Connecting to localhost/127.0.0.1:3052 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG o.a.h.i.c.HttpClientConnectionOperator - Connection established 127.0.0.1:50744<->127.0.0.1:3052 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG o.a.h.impl.execchain.MainClientExec - Executing request POST /session HTTP/1.1 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG o.a.h.impl.execchain.MainClientExec - Target auth state: UNCHALLENGED 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG o.a.h.impl.execchain.MainClientExec - Proxy auth state: UNCHALLENGED 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG org.apache.http.headers - http-outgoing-0 >> POST /session HTTP/1.1 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Type: application/json; charset=utf-8 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG org.apache.http.headers - http-outgoing-0 >> Content-Length: 169 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG org.apache.http.headers - http-outgoing-0 >> Host: localhost:3052 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG org.apache.http.headers - http-outgoing-0 >> User-Agent: Apache-HttpClient/4.3.4 (java 1.5) 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG org.apache.http.wire - http-outgoing-0 >> "POST /session HTTP/1.1[\r][\n]" 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Type: application/json; charset=utf-8[\r][\n]" 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG org.apache.http.wire - http-outgoing-0 >> "Content-Length: 169[\r][\n]" 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG org.apache.http.wire - http-outgoing-0 >> "Host: localhost:3052[\r][\n]" 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG org.apache.http.wire - http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]" 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG org.apache.http.wire - http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.3.4 (java 1.5)[\r][\n]" 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG org.apache.http.wire - http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]" 18:27:00.774 [Forwarding newSession on session null to remote] DEBUG org.apache.http.wire - http-outgoing-0 >> "[\r][\n]"