Skip to content

Can’t turn off HttpClient Wire debug log messages

I have been trying to set Wire to not send DEBUG to console, but no matter what I do, it won’t listen.

I have log4j initialized properly: I do not get any appender messages, log4j is obeying my class and console levels.

In I have every foreseeable way to write wire:

I then thought why not print all loggers after calling it? So i did just that. I get a nice printout of everything mentioned above, and my current class. Nothing else prints from iterating through LogManager.getCurrentLoggers()

I think I’ve read every result on Google at this point. Any guidance would be appreciated.

About the project: Project is a maven Project – pom.xml includes the resource folder. To make this work I literally made a ControlLogging class and PropertyConfiguratior.configure("") is called first. I call this function @Before test runs, and in the static class that’s making the API calls. Doing the printing at any point doesn’t reveal the Wire logger.



So what did finally work for my project was creating a configuration for sl4j / logback — I couldn’t make it work for log4j etc.

So under main/java/resources/logback.xml

<xml version="1.0" encoding="UTF-8" ?>
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
          <pattern>%d{HH:mm:ss} %thread %-5level %logger{36} %msg%n</pattern>

     <logger name="org.apache" level="ERROR"/>
     <logger name="httpclient" level="ERROR"/>

     <root level="DEBUG">
          <appender-ref ref="STDOUT" />

in maven I simply included dependency for slf4j


and its all working now.