HttpClient is logging on INFO-level - how to change to ERROR?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

HttpClient is logging on INFO-level - how to change to ERROR?

JavaChristian
Hi list,

I use HttpClient 2.0 that - according to the documentation - depends on
commons-logging-1.1 which I installed and added to CLASSPATH. Actually I
fail to change the log-level and got stuck with the search, where I can
change from INFO to ERROR.

My first glance in the logging-documentation made me try two different
lines. The first does have no effect on the HttpClient (it still is
logging on INFO-level) and the second line seems to confuse the
logging-factory.

System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "error");

// no effect, still getting messages such as
//
// 05.01.2007 17:40:45 org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
// INFO: basic authentication scheme selected

System.setProperty("org.apache.commons.logging.Log", "error");

// crashes a few lines later
//
// java.lang.ExceptionInInitializerError
//         at HttpPasswordTester.main(HttpPasswordTester.java:23)
// Caused by: org.apache.commons.logging.LogConfigurationException: User-specified log class 'error' cannot be found or is not useable.
//         at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:798)
//         at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:601)
//         at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:333)
//         at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:307)
//         at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645)
//         at org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:65)
//         ... 1 more

Can anybody tell me where or even how I can change the log-level for the
HttpClient?

Best regards,

Christian


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HttpClient is logging on INFO-level - how to change to ERROR?

Christian Hufgard
Hello Christian,

Which implementation do you use for the actual logging?

I guess that you aren't using any, so the default SimpleLog is used. I
think a look at
http://jakarta.apache.org/commons/logging/commons-logging-1.1/guide.html#A_Quick_Guide_To_Simple_Log
should solve your current problem.

> System.setProperty("org.apache.commons.logging.Log", "error");
This code does not work since it instructs commons-logging to use a
class "error" as Log implementation.

- Christian


Friday, January 5, 2007, 6:03:48 PM, you wrote:

> Hi list,

> I use HttpClient 2.0 that - according to the documentation - depends on
> commons-logging-1.1 which I installed and added to CLASSPATH. Actually I
> fail to change the log-level and got stuck with the search, where I can
> change from INFO to ERROR.

> My first glance in the logging-documentation made me try two different
> lines. The first does have no effect on the HttpClient (it still is
> logging on INFO-level) and the second line seems to confuse the
> logging-factory.

> System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "error");

> // no effect, still getting messages such as
> //
> // 05.01.2007 17:40:45
> org.apache.commons.httpclient.auth.AuthChallengeProcessor
> selectAuthScheme
> // INFO: basic authentication scheme selected

> System.setProperty("org.apache.commons.logging.Log", "error");

> // crashes a few lines later
> //
> // java.lang.ExceptionInInitializerError
> //         at HttpPasswordTester.main(HttpPasswordTester.java:23)
> // Caused by:
> org.apache.commons.logging.LogConfigurationException: User-specified
> log class 'error' cannot be found or is not useable.
> //         at
> org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:798)
> //         at
> org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:601)
> //         at
> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:333)
> //         at
> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:307)
> //         at
> org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645)
> //         at
> org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:65)
> //         ... 1 more

> Can anybody tell me where or even how I can change the log-level for the
> HttpClient?

> Best regards,

> Christian


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail:
> [hidden email]



--
Best regards,
 Christian                            mailto:[hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re[2]: HttpClient is logging on INFO-level - how to change to ERROR?

JavaChristian
Hey Christian,

CH> Which implementation do you use for the actual logging?

To be honest: I do not have any idea. Since I did not specify a
particular implementation I do assume that SimpleLog is used. But if so,
these both lines should affect logging:

System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "fatal");
System.setProperty("org.apache.commons.logging.simplelog.showlogname", "true");

Though there shoud be some change in the log-behaviour (according to the
manual you suggested
[http://jakarta.apache.org/commons/logging/commons-logging-1.1/guide.html#A_Quick_Guide_To_Simple_Log])
I still recieve the following log-messages:

06.01.2007 13:37:04 org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
INFO: basic authentication scheme selected

To me this means: neither the log-level has changed nor the log-name in
displayed - if I set the properties correct (which seems undoubtedly to
me) SimpleLog is *not* used.

So an other question is: How can I determine which log-implementation
my HttpClient actually does use?

Thanks in advance and kind regards,

Christian

CH> I guess that you aren't using any, so the default SimpleLog is used. I
CH> think a look at
CH> http://jakarta.apache.org/commons/logging/commons-logging-1.1/guide.html#A_Quick_Guide_To_Simple_Log
CH> should solve your current problem.

>> System.setProperty("org.apache.commons.logging.Log", "error");
CH> This code does not work since it instructs commons-logging to use a
CH> class "error" as Log implementation.

CH> - Christian


CH> Friday, January 5, 2007, 6:03:48 PM, you wrote:

>> Hi list,

>> I use HttpClient 2.0 that - according to the documentation - depends on
>> commons-logging-1.1 which I installed and added to CLASSPATH. Actually I
>> fail to change the log-level and got stuck with the search, where I can
>> change from INFO to ERROR.

>> My first glance in the logging-documentation made me try two different
>> lines. The first does have no effect on the HttpClient (it still is
>> logging on INFO-level) and the second line seems to confuse the
>> logging-factory.

>> System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "error");

>> // no effect, still getting messages such as
>> //
>> // 05.01.2007 17:40:45
>> org.apache.commons.httpclient.auth.AuthChallengeProcessor
>> selectAuthScheme
>> // INFO: basic authentication scheme selected

>> System.setProperty("org.apache.commons.logging.Log", "error");

>> // crashes a few lines later
>> //
>> // java.lang.ExceptionInInitializerError
>> //         at HttpPasswordTester.main(HttpPasswordTester.java:23)
>> // Caused by:
>> org.apache.commons.logging.LogConfigurationException: User-specified
>> log class 'error' cannot be found or is not useable.
>> //         at
>> org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:798)
>> //         at
>> org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:601)
>> //         at
>> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:333)
>> //         at
>> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:307)
>> //         at
>> org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645)
>> //         at
>> org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:65)
>> //         ... 1 more

>> Can anybody tell me where or even how I can change the log-level for the
>> HttpClient?

>> Best regards,

>> Christian


>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail:
>> [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HttpClient is logging on INFO-level - how to change to ERROR?

Dennis Lundberg-2
Christian Kruggel wrote:

> Hey Christian,
>
> CH> Which implementation do you use for the actual logging?
>
> To be honest: I do not have any idea. Since I did not specify a
> particular implementation I do assume that SimpleLog is used. But if so,
> these both lines should affect logging:
>
> System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "fatal");
> System.setProperty("org.apache.commons.logging.simplelog.showlogname", "true");
>
> Though there shoud be some change in the log-behaviour (according to the
> manual you suggested
> [http://jakarta.apache.org/commons/logging/commons-logging-1.1/guide.html#A_Quick_Guide_To_Simple_Log])
> I still recieve the following log-messages:
>
> 06.01.2007 13:37:04 org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
> INFO: basic authentication scheme selected

This looks like JDK 1.4 logging to me.

> To me this means: neither the log-level has changed nor the log-name in
> displayed - if I set the properties correct (which seems undoubtedly to
> me) SimpleLog is *not* used.

If you want to use SimpleLog add this system property:
   org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog

> So an other question is: How can I determine which log-implementation
> my HttpClient actually does use?

You can see that if you turn on diagnostics logging in commons-logging.
Instructions for this can be found here:
 
http://jakarta.apache.org/commons/logging/troubleshooting.html#Using_JCL_Diagnostics

> Thanks in advance and kind regards,
>
> Christian
>
> CH> I guess that you aren't using any, so the default SimpleLog is used. I
> CH> think a look at
> CH> http://jakarta.apache.org/commons/logging/commons-logging-1.1/guide.html#A_Quick_Guide_To_Simple_Log
> CH> should solve your current problem.
>
>>> System.setProperty("org.apache.commons.logging.Log", "error");
> CH> This code does not work since it instructs commons-logging to use a
> CH> class "error" as Log implementation.
>
> CH> - Christian
>
>
> CH> Friday, January 5, 2007, 6:03:48 PM, you wrote:
>
>>> Hi list,
>
>>> I use HttpClient 2.0 that - according to the documentation - depends on
>>> commons-logging-1.1 which I installed and added to CLASSPATH. Actually I
>>> fail to change the log-level and got stuck with the search, where I can
>>> change from INFO to ERROR.
>
>>> My first glance in the logging-documentation made me try two different
>>> lines. The first does have no effect on the HttpClient (it still is
>>> logging on INFO-level) and the second line seems to confuse the
>>> logging-factory.
>
>>> System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "error");
>
>>> // no effect, still getting messages such as
>>> //
>>> // 05.01.2007 17:40:45
>>> org.apache.commons.httpclient.auth.AuthChallengeProcessor
>>> selectAuthScheme
>>> // INFO: basic authentication scheme selected
>
>>> System.setProperty("org.apache.commons.logging.Log", "error");
>
>>> // crashes a few lines later
>>> //
>>> // java.lang.ExceptionInInitializerError
>>> //         at HttpPasswordTester.main(HttpPasswordTester.java:23)
>>> // Caused by:
>>> org.apache.commons.logging.LogConfigurationException: User-specified
>>> log class 'error' cannot be found or is not useable.
>>> //         at
>>> org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:798)
>>> //         at
>>> org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:601)
>>> //         at
>>> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:333)
>>> //         at
>>> org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:307)
>>> //         at
>>> org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645)
>>> //         at
>>> org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:65)
>>> //         ... 1 more
>
>>> Can anybody tell me where or even how I can change the log-level for the
>>> HttpClient?
>
>>> Best regards,
>
>>> Christian
>
>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail:
>>> [hidden email]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


--
Dennis Lundberg

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re[2]: HttpClient is logging on INFO-level - how to change to ERROR?

JavaChristian
Hello Dennis!

DL> This looks like JDK 1.4 logging to me.

In deed, it was.

DL> If you want to use SimpleLog add this system property:
DL>    org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog

Marvellous, this property did the trick. Thanks a lot!

Christian


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]