Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging #11

Open
tmasselink opened this issue Sep 22, 2016 · 1 comment
Open

Logging #11

tmasselink opened this issue Sep 22, 2016 · 1 comment

Comments

@tmasselink
Copy link

How do I log the request/responses sent and received by the client? The JSON and the headers would be nice.

I've added these properties:

@tmasselink
Copy link
Author

Don't know how that comment got submitted....

But these are the properties I set:

System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http.impl.conn", "DEBUG");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http.impl.client", "DEBUG");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http.client", "DEBUG");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http", "DEBUG");

which then outputs:

452 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Executing request GET /v1/user/354ce659-92fc-4e95-8778-8598e6889870 HTTP/1.1
452 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Target auth state: CHALLENGED
457 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Proxy auth state: UNCHALLENGED
557 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection can be kept alive indefinitely
557 [main] DEBUG org.apache.http.impl.auth.HttpAuthenticator - Authentication succeeded
...
602 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Executing request PUT /v1/user/354ce659-92fc-4e95-8778-8598e6889870 HTTP/1.1
602 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Target auth state: CHALLENGED
602 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Proxy auth state: UNCHALLENGED
735 [main] DEBUG org.apache.http.impl.execchain.MainClientExec - Connection can be kept alive indefinitely
735 [main] DEBUG org.apache.http.impl.auth.HttpAuthenticator - Authentication succeeded

But not the actual JSON sent or received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant