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 ?
You can configure Jetty's
HttpClientwith the logging levelorg.eclipse.jetty.client=DEBUG, and any logging framework should logHttpClient's activity.Alternatively, if you use the default Jetty logging system, you can configure a
jetty-logging.propertiesin 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
HttpClientdoes not log just HTTP traffic, but all the activity ofHttpClient'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.