You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by bagas <ba...@indoartha.co.id> on 2004/05/05 04:49:41 UTC

[newbie] Logger Appender

Hi all,
 
I try to use log4j as httpclient logger but I receive a warning :
 
log4j:WARN No appenders could be found for logger
(org.apache.commons.httpclient.HttpClient).
log4j:WARN Please initialize the log4j system properly.
 
How can set an appender to a logger ? please give me a example
 
Thanx 

Re: [newbie] Logger Appender

Posted by Michael Becke <be...@u.washington.edu>.
Hi Bagas,

This is a questions for the Log4j folks.  Please take a look their site 
for some documentation on log4j configuration 
<http://logging.apache.org/log4j/docs/>.

Mike

On May 4, 2004, at 10:49 PM, bagas wrote:

> Hi all,
>
> I try to use log4j as httpclient logger but I receive a warning :
>
> log4j:WARN No appenders could be found for logger
> (org.apache.commons.httpclient.HttpClient).
> log4j:WARN Please initialize the log4j system properly.
>
> How can set an appender to a logger ? please give me a example
>
> Thanx


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Re: [newbie] Logger Appender

Posted by Ortwin Glück <or...@nose.ch>.
---- log4.properties
log4j.rootCategory=DEBUG, C

log4j.appender.F=org.apache.log4j.FileAppender
log4j.appender.F.File=C:/Temp/my.log
log4j.appender.F.layout=org.apache.log4j.PatternLayout
log4j.appender.F.layout.ConversionPattern = %d %-5p [%t] %c %3x - %m\n

log4j.appender.N=org.apache.log4j.net.SocketAppender
log4j.appender.N.RemoteHost=localhost
log4j.appender.N.Port=4445
log4j.appender.N.ReconnectionDelay=5000
log4j.appender.N.layout=org.apache.log4j.PatternLayout
log4j.appender.N.layout.ConversionPattern = %d %-5p [%t] %c %3x - %m\n

log4j.appender.C=org.apache.log4j.ConsoleAppender
log4j.appender.C.layout=org.apache.log4j.PatternLayout
log4j.appender.C.layout.ConversionPattern = %d %-5p [%t] %c %3x - %m\n
----

The above defines 3 different appenders and uses the console appender 
for DEBUG level (all) output.
To use the file appender instead, change the first line to:
log4j.rootCategory=DEBUG, F

Please refer to the Log4J documentation or other resources on the web 
for more information.

Ortwin Glück

bagas wrote:
> Hi all,
>  
> I try to use log4j as httpclient logger but I receive a warning :
>  
> log4j:WARN No appenders could be found for logger
> (org.apache.commons.httpclient.HttpClient).
> log4j:WARN Please initialize the log4j system properly.
>  
> How can set an appender to a logger ? please give me a example
>  
> Thanx 
> 

-- 
  _________________________________________________________________
  NOSE applied intelligence ag

  ortwin glück                      [www]      http://www.nose.ch
  software engineer                 [email] ortwin.glueck@nose.ch
  hardturmstrasse 171               [pgp id]           0x81CF3416
  8005 zürich                       [office]      +41-1-277 57 35
  switzerland                       [fax]         +41-1-277 57 12

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Re: [newbie] Logger Appender

Posted by Sam Berlin <sb...@limepeer.com>.
This error generally means the log4j.properties file is not in the 
classpath.

Thanks,
  Sam

On Tuesday, May 4, 2004, at 10:49  PM, bagas wrote:

> Hi all,
>
> I try to use log4j as httpclient logger but I receive a warning :
>
> log4j:WARN No appenders could be found for logger
> (org.apache.commons.httpclient.HttpClient).
> log4j:WARN Please initialize the log4j system properly.
>
> How can set an appender to a logger ? please give me a example
>
> Thanx


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org