You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Robert Rowntree <ro...@gmail.com> on 2012/01/22 22:16:03 UTC

not getting debug logs for httpclient.wire.header using Commons Logging

I used httpcomponents-client-4.1.2 in java running from eclipse

i read the examples for both commons logging and for log4j, trying both of
them in order to get headers logged.

No logs produced on HTTP POST , only received the eclipse-syslog below.

edit
https://picasaweb.google.com/data/entry/api/user/rowntreerob/albumid/5657647416240712401/photoid/5657647532724451170
wire loglvl debug
in client.exec method
log prop org.apache.commons.logging.impl.SimpleLog
in contentProd.writeTo method
org.apache.http.NoHttpResponseException: The target server failed to respond
at
org.apache.http.impl.io.HttpResponseParser.parseHead(HttpResponseParser.java:92)
at
org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:252)
at
org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281)
at
org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:298)
at
org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at com.b2bpo.media.*ClientHttpGeo.execute(ClientHttpGeo.java:166)*
at com.b2bpo.media.OauthClient.main(OauthClient.java:146)

this is doing  a

     response = httpexecutor.execute(request, conn, context);

at  ClientHttpGeo.execute(ClientHttpGeo.java:166

There should be http headers on stdout in eclipse... There is nothing but
what i showed above

How do i get detailed logging?

i ran with the following System properties:

-Dorg.apache.commons.logging.Log="org.apache.commons.logging.impl.SimpleLog"
-Dorg.apache.commons.logging.simplelog.showdatetime="true"
-Dorg.apache.commons.logging.simplelog.log.httpclient.wire.header="debug"
-Dorg.apache.commons.logging.simplelog.log.httpclient.wire="debug"
-Dorg.apache.commons.logging.simplelog.log.org.apache.commons.httpclient="debug"

no good.

i coded java statements for the above properties at the beginning of the
'main' routine and that approach did not work either.

i also included log4j and slf4j jars and put a log4j.properties file on the
CP and that did not work either.

Re: not getting debug logs for httpclient.wire.header using Commons Logging

Posted by Robert Rowntree <ro...@gmail.com>.
Resolved by changing the system properties to the following:

-Dorg.apache.commons.logging.Log="org.apache.commons.logging.impl.SimpleLog"
-Dorg.apache.commons.logging.simplelog.showdatetime="true"
-Dorg.apache.commons.logging.simplelog.defaultlog="debug"

this turned on full debug.

also verified that CP contained dir in which 'commons-logging.properties'
resides and that the file contains:


 org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog