logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <ggreg...@apache.org>
Subject Re: Log4J doesn't work at all
Date Tue, 10 Apr 2012 11:56:55 GMT
See http://logging.apache.org/log4j/1.2/manual.html under "Default
Initialization Procedure"

Gary

On Tue, Apr 10, 2012 at 6:23 AM, tommmmmm <tommmmmm@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).
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: http://bit.ly/ECvg0
Spring Batch in Action: http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory <http://twitter.com/GaryGregory>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message