Reputation: 5843
How to view http traffic in jetty http client ?
I tried apache logger format
to set 'org.eclipse.jetty' to TRACE level,
still unable to view http traffic, similar to apache http client wire logging.
Is there any way to log http traffic in jetty http client ?
Upvotes: 0
Views: 1158
Reputation: 18507
You can configure Jetty's HttpClient
with the logging level org.eclipse.jetty.client=DEBUG
, and any logging framework should log HttpClient
's activity.
Alternatively, if you use the default Jetty logging system, you can configure a jetty-logging.properties
in the class-path, with the same logging level described above.
Lastly, if you use the default Jetty logging system, you can specify this system property on the command line: -Dorg.eclipse.jetty.client.LEVEL=DEBUG
.
Note that in this way Jetty's HttpClient
does not log just HTTP traffic, but all the activity of HttpClient
's implementation.
There is no logging category for just HTTP traffic because the exact headers that are sent to the server could be decided at the very last moment just before writing them to the network -- this is particularly true for content headers (but also for authentication), so it would require collaboration from different Jetty modules.
Upvotes: 1