On 11 April 2012 15:05, Bill Speirs <[email protected]> wrote:

> Tom-
>
> HttpClient is not the issue here, it is commons-logging... please don't
> accuse libraries/groups, especially when they are trying to help you.
>
> From the commons-logging "Quick Start" guide: "As far as possible, JCL
> tries to be as unobtrusive as possible. In most cases, including the (full)
> commons-logging.jar in the classpath should result in JCL configuring
> itself in a reasonable manner. There's a good chance that it'll guess
> (discover) your preferred logging system and you won't need to do any
> configuration of JCL at all! Note, however, that if you have a particular
> preference then *providing a simple commons-logging.properties file which
> specifies the concrete logging library to be used is recommended*, since
> (in this case) JCL will log only to that system and will report any
> configuration problems that prevent that system being used." [1]
>
> To ensure that commons-logging is using the log4j implementation that
> you've specified, add commons-logging.properties to your class path with
> the following
> line:
> org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
>
> This will tell commons-logging which logging implementation, log4j in this
> case, to use. Because HttpClient is using commons-logging for all of its
> logs, this will send those logs to your log4j setup.
>
> Why do you have to do this at all? Commons-logging tries to guess which
> logging framework you'd like to use. For some reason, I'm not going to
> attempt to figure out why but the source is all there if you want to have a
> look, commons-logging is probably finding the java.util.logging
> implementation and trying to use that. Because you don't have it setup,
> those messages are going away.
>
> I hope this helps.
>
> [1]  http://commons.apache.org/logging/guide.html#Quick Start
>
> Bill-
>
>
Added in commons-logging.properties:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

Set in classpath = yes.

Validation check if it's really in classpath:
System.out.println(httpClient.getClass().getClassLoader().getResource("commons-logging.properties"));
prints: 
file:/home/min/ucng/ucng_java/sBorgJava/src/logging/commons-logging.properties

Helped = no.

More ideas?

Reply via email to