JeffAyers
1 Copper

Logging Atmos Java API HttpClient calls

Jump to solution

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

0 Kudos
1 Solution

Accepted Solutions
JasonCwik
3 Argentium

Re: Logging Atmos Java API HttpClient calls

Jump to solution

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

0 Kudos
2 Replies
JasonCwik
3 Argentium

Re: Logging Atmos Java API HttpClient calls

Jump to solution

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

0 Kudos
JeffAyers
1 Copper

Re: Logging Atmos Java API HttpClient calls

Jump to solution

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

0 Kudos