How are you running all of this? Maven, Eclipse, NetBeans? Sometimes IDEs can put resources in weird places (I always struggled to divine where Eclipse wanted me to put my logging configuration files, until I started using Maven... /src/main/resources).
I have the following XML configuration file for log4j (using slf4j in my program) and I can get HttpClient to print messages: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <!-- See: http://wiki.apache.org/logging-log4j/Log4jXmlFormat --> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <!-- This appender prints to the console --> <appender name="console" class="org.apache.log4j.ConsoleAppender"> <param name="Target" value="System.out" /> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="[%C:%t] %m%n"/> </layout> <filter class="org.apache.log4j.varia.LevelRangeFilter"> <param name="levelMin" value="DEBUG" /> <param name="levelMax" value="FATAL" /> </filter> </appender> <!-- The root must be last! --> <root> <!-- Order here matters: param, level, appender-ref --> <level value="info" /> <appender-ref ref="console" /> </root> </log4j:configuration> Bill- On Tue, Apr 10, 2012 at 9:30 AM, tommmmmm <[email protected]> wrote: > I tried: > > System.setProperty("org.apache.commons.logging.Log", > "org.apache.commons.logging.impl.SimpleLog"); > > System.setProperty("org.apache.commons.logging.simplelog.showdatetime", > "true"); > > System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http", > "DEBUG"); > > System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http.wire", > "ERROR"); > > Yes, that is another almost exactly copy-pasted example from the HttpClient > website. Didn't work. > > The class really isn't big - one main method + couple lines. So I have no > idea how this could happen quote: "If Commons Logging picked up another > backend " > > Also, there is this thing, that if there was some other backend then the > line: logger.debug("some test message"); would produce no output at all. > And since it does, it means it IS HttpClient issue. > > For the record, I am simply using a provided jar from the website (no fancy > stuff). --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
