Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

1091

September 11th, 2012 12:00

Logging Atmos Java API HttpClient calls

Its my understanding that Atmos Java API uses Apache HttpClient to make REST calls. Since HttpClient can log to the console (see http://hc.apache.org/httpcomponents-client-ga/logging.html), I was hopeful to see the GET commands in my Eclipse console by adding to my log4j.properties file:

           log4j.logger.org.apache.http=DEBUG

I know the logging works since I deliberatedly added a few logging lines to make sure log4j was setup correctly. Any ideas would be appreciated.

Sincerely,

Jeff

281 Posts

September 11th, 2012 13:00

We only use the Apache HttpClient if requested.  To do this, initialize an object of class EsuRestApiApache instead of the usual EsuRestApi.  I just tested the log4j setting above and got the low-level tracing:

15:09:07,447 DEBUG [main] ThreadSafeClientConnManager$1: Get connection: HttpRoute[{}->http://10.242.26.242], timeout = 0

15:09:07,447 DEBUG [main] ConnPoolByRoute: [HttpRoute[{}->http://10.242.26.242]] total kept alive: 0, total issued: 0, total allocated: 0 out of 200

15:09:07,447 DEBUG [main] ConnPoolByRoute: No free connections [HttpRoute[{}->http://10.242.26.242]][null]

15:09:07,447 DEBUG [main] ConnPoolByRoute: Available capacity: 200 out of 200 [HttpRoute[{}->http://10.242.26.242]][null]

15:09:07,448 DEBUG [main] ConnPoolByRoute: Creating new connection [HttpRoute[{}->http://10.242.26.242]]

15:09:07,448 DEBUG [main] DefaultClientConnectionOperator: Connecting to /10.242.26.242:80

7 Posts

September 11th, 2012 14:00

Thank you for the quick response. Your answer did the trick.

No Events found!

Top