Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: tommmmmm <tommmmmm <at> gmail.com>
Subject: Log4J doesn't work at all
Newsgroups: gmane.comp.jakarta.log4j.user
Date: Tuesday 10th April 2012 10:23:55 UTC (over 4 years ago)
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



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).
 
CD: 3ms