That system property stuff only applies to commons-logging, not Log4j.  Look more closely at the instructions [1].

BTW, are you using commons-logging-api.jar?  If so, that's the problem.  You need commons-logging.jar.  See the commons-logging release notes [2].

[1] http://hc.apache.org/httpcomponents-client-ga/logging.html
[2] http://commons.apache.org/logging/RELEASE-NOTES.txt


Jake

On Tue, 10 Apr 2012 12:23:55 +0200
 tommmmmm <tommm...@gmail.com> wrote:
From: http://hc.apache.org/httpcomponents-client-ga/logging.html
I copy pasted

log4j.rootLogger=INFO, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%c] %m%n

log4j.logger.org.apache.http=DEBUG
log4j.logger.org.apache.http.wire=ERROR

Into a file I named log4j.properties that I put into src folder a'ka
<default package>


Didn't work at all.


Then I put this in my class:

System.setProperty("log4j.rootLogger", "INFO, stdout");

System.setProperty("log4j.appender.stdout",
"org.apache.log4j.ConsoleAppender");

System.setProperty("log4j.appender.stdout.layout",
"org.apache.log4j.PatternLayout");

System.setProperty("log4j.appender.stdout.layout.ConversionPattern",
"%5p [%c] %m%n");

System.setProperty("log4j.logger.org.apache.http.client", "DEBUG");

System.setProperty("log4j.logger.org.apache.http", "DEBUG");

System.setProperty("log4j.logger.org.apache.http.wire", "DEBUG");


Yet it didn't work at all either. No additional output was produced.


How do you make it work?


ps: at: http://logging.apache.org/log4j/1.2/manual.html

It's not written how to do it (empty paragraph "Example
Configurations" and non empty yet ultimately useless Tomcat
paragraph).


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to