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: can not turn off log under HttpClient
Date Wed, 20 Oct 2004 08:44:59 GMT
If you use Log4J, put the following in your log4j.properties:

log4j.rootLogger=ERROR, 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

Alternatively you can use System properties to control commons-logging:

System.setProperty("org.apache.commons.logging.Log", 
"org.apache.commons.logging.impl.SimpleLog");
System.setProperty("org.apache.commons.logging.simplelog.showdatetime", 
"true");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient",

"error");


O.
jrlecq@easyvoyage.fr wrote:

> Hello,
> 
> When I read trace in my catalina.out, I find this information many many time
> :
> 
>>20 oct. 2004 10:21:27 org.apache.commons.httpclient.HttpMethodBase
> 
> processRedirectResponse
> 
>>INFO: Redirect requested but followRedirects is disabled
> 
> 
> I read carefully the HttpClient user guide about logging and Apache common
> logging guide, but I don't find how turn off thoses traces.
> 
> I tried this but it s don' t work :
> MyClass{
> /** logging **/
> 	private static Log log1 =
> LogFactory.getLog("org.apache.commons.logging.Log");
> 	private static Log log2 =
> LogFactory.getLog("org.apache.commons.logging.impl.SimpleLog");
> 	private static Log log3 =
> LogFactory.getLog("org.apache.commons.logging.simplelog.log.httpclient.wire"
> );
> 	private static Log log4 =
> LogFactory.getLog("org.apache.commons.logging.simplelog.log.org.apache.commo
> ns.httpclient");
> 	private static Log log5 =
> LogFactory.getLog("org.apache.commons.logging.simplelog.defaultlog");
> 	...
> 
>   MyClassConstructor(){
>     log1.isFatalEnabled();
>     log2.isFatalEnabled();
>     log3.isFatalEnabled();
>     log4.isFatalEnabled();
>     log5.isFatalEnabled();
>     ...
>   }
> }
> 
> If someone have an idea ...
> 
> Thx
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org

-- 
  _________________________________________________________________
  NOSE applied intelligence ag

  ortwin glück                      [www]      http://www.nose.ch
  software engineer
  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