hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ortwin Glück <ortwin.glu...@nose.ch>
Subject Re: [newbie] Logger Appender
Date Wed, 05 May 2004 07:22:22 GMT
---- 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


Mime
View raw message