hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tommmmmm <tommm...@gmail.com>
Subject Re: How to use logging abilities of HttpClient?
Date Wed, 11 Apr 2012 09:13:09 GMT
I used
System.setProperty("log4j.defaultInitOverride", "true");

So I can get clean loading:
log4j: Default initialization of overridden by
log4j.defaultInitOverrideproperty.
log4j: Parsing for [root] with value=[DEBUG, stdout].
log4j: Level token is [DEBUG].
log4j: Category root set to DEBUG
log4j: Parsing appender named "stdout".
log4j: Parsing layout options for "stdout".
log4j: Setting property [conversionPattern] to [%5p [%c] %m%n].
log4j: End of parsing for "stdout".
log4j: Parsed "stdout" options.
log4j: Parsing for [org.apache.http.wire] with value=[DEBUG].
log4j: Level token is [DEBUG].
log4j: Category org.apache.http.wire set to DEBUG
log4j: Handling log4j.additivity.org.apache.http.wire=[null]
log4j: Parsing for [org.apache.http] with value=[DEBUG].
log4j: Level token is [DEBUG].
log4j: Category org.apache.http set to DEBUG
log4j: Handling log4j.additivity.org.apache.http=[null]
log4j: Parsing for [jobManager] with value=[DEBUG]. <--------------- That
proves that MY config file is being loaded
log4j: Level token is [DEBUG].
log4j: Category jobManager set to DEBUG
log4j: Handling log4j.additivity.jobManager=[null]
log4j: Finished configuring.
DEBUG [jobManager.UploadManager] some test message
<--- Here should be output of HttpClient but its not --->
DEBUG [jobManager.UploadManager] some test message

I slept with the problem, yet no solutions came to my mind.
For the sake of clarity here is output of:
        ClassLoader cl = ClassLoader.getSystemClassLoader();
        URL[] urls = ((URLClassLoader) cl).getURLs();
        for (URL url : urls) {
            System.out.println(url.getFile());
        }

/home/min/ucng/javaLibs/httpcomponents-client-4.1.3/lib/commons-codec-1.4.jar
/home/min/ucng/javaLibs/httpcomponents-client-4.1.3/lib/httpclient-4.1.3.jar
/home/min/ucng/javaLibs/httpcomponents-client-4.1.3/lib/httpclient-cache-4.1.3.jar
/home/min/ucng/javaLibs/httpcomponents-client-4.1.3/lib/httpcore-4.1.4.jar
/home/min/ucng/javaLibs/httpcomponents-client-4.1.3/lib/httpmime-4.1.3.jar
/home/min/ucng/javaLibs/commons-logging-1.1.1/commons-logging-1.1.1.jar
/home/min/ucng/javaLibs/apache-log4j-1.2.16/log4j-1.2.16.jar
/home/min/ucng/javaLibs/commons-codec-1.6/commons-codec-1.6-javadoc.jar
/home/min/ucng/javaLibs/commons-codec-1.6/commons-codec-1.6-tests.jar
/home/min/ucng/javaLibs/commons-codec-1.6/commons-codec-1.6.jar
/home/min/ucng/javaLibs/selenium-server-standalone-2.20.0.jar
/home/min/ucng/javaLibs/scribe-1.3.0.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/pbapi-j2se.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/apache-mime4j-0.6.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/commons-codec-1.3.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/commons-codec-1.4.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/commons-lang-2.4.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/commons-logging-1.1.1.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/commons-validator-1.3.1.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/httpclient-4.0.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/httpclient-4.1.3.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/httpclient-cache-4.1.3.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/httpcore-4.0.1.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/httpcore-4.1.4.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/httpmime-4.0.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/httpmime-4.1.3.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/jcip-annotations-1.0.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/json-1.0.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/junit-4.9b2.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/log4j-1.2.16.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/signpost-commonshttp4-1.2.1.1.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/signpost-commonshttp4-1.2.1.2.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/signpost-core-1.2.1.1.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/signpost-core-1.2.1.2.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/signpost-jetty6-1.2.1.2.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/slf4j-api-1.6.1.jar
/home/min/ucng/javaLibs/pbapi-full-1.4.0.91/dist/lib/default/slf4j-log4j12-1.6.1.jar

The output of:
System.out.println(httpClient.getClass().getClassLoader().getResource("log4j.properties"));
is: null <--- I don't know if it is relevant or not.

I thought about log4j.jar being in a different folder than httpClient but
it shouldn't matter since it's the classpath that rules over.
I am really out of ideas.

Help please :( q.q

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