> But I don't want to use commons-logging. I want to use log4j.
You are missing the point. **You** want to use Log4j. That's fine. But
HttpClient doesn't directly use Log4j. It directly uses commons-logging,
which is a Logger adapter that supports various logging implementations, one
of which is Log4j.
If you want to use Log4j, then you ***have*** to use commons-logging.jar, and
NOT commons-logging-api.jar, plus log4j.jar. To avoid commons-logging (and
some of the problems it can create), you can skip commons-logging.jar and use
SLF4J [1]: jcl-over-slf4j.jar + slf4j-api.jar + slf4j-log4j12.jar +
log4j.jar. But either way, you can't avoid having the commons-logging
packages/classes (which jcl-over-slf4j.jar mimics) in the classpath because
HttpClient has a hard dependency on it.
> In any case, that System.property stuff didn't help either.
Because it's commons-logging specific and totally irrelevant to Log4j.
Besides, you were setting Log4j packages as properties and that is totally
meaningless. For instance, you wrote...
System.setProperty("log4j.logger.org.apache.http.client", "DEBUG");
But HttpClient's instructions say to do (again, read the instructions more
closely)...
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http.wire",
"DEBUG");
> Part of the code simply gets..... ignored. Why?
Because you are not following instructions.
[1]
http://slf4j.org/legacy.html#jcl-over-slf4jJake
On Tue, 10 Apr 2012 16:08:07 +0200
tommmmmm <
tommmmmm@...> wrote:
---------------------------------------------------------------------
To unsubscribe, e-mail:
log4j-user-unsubscribe@...
For additional commands, e-mail:
log4j-user-help@...