java.lang.Object
io.avaje.http.client.RequestLogger
- All Implemented Interfaces:
RequestListener
Logs request and response details for debug logging purposes using
System.Logger
.
This implementation logs the request and response with the same single logging entry rather than separate logging of the request and response.
With logging level set to DEBUG
for io.avaje.http.client.RequestLogger
the
request and response are logged as a summary with response status and time.
Set the logging level to TRACE
to include the request and response headers and body
payloads with truncation for large bodies.
Using System.Logger, messages by default go to JUL (Java Util Logging) unless a provider is registered. We can use io.avaje:avaje-slf4j-jpl to have System.Logger messages go to slf4j-api.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.avaje.http.client.RequestListener
RequestListener.Event
-
Constructor Summary
ConstructorDescriptionCreate using the \n new line character.RequestLogger
(String delimiter) Create with a given line delimiter. -
Method Summary
Modifier and TypeMethodDescriptionvoid
response
(RequestListener.Event event) Handle the response.
-
Constructor Details
-
RequestLogger
public RequestLogger()Create using the \n new line character. -
RequestLogger
Create with a given line delimiter.
-
-
Method Details
-
response
Description copied from interface:RequestListener
Handle the response.- Specified by:
response
in interfaceRequestListener
-