Package org.zalando.logbook
Interface StructuredHttpLogFormatter
- All Superinterfaces:
HttpLogFormatter
-
Method Summary
Modifier and TypeMethodDescriptionRenders properties of an HTTP message into a JSON string.default String
format
(Correlation correlation, HttpResponse response) default String
format
(Precorrelation precorrelation, HttpRequest request) prepare
(Correlation correlation, HttpResponse response) Produces a map of individual properties from an HTTP response.prepare
(Precorrelation precorrelation, HttpRequest request) Produces a map of individual properties from an HTTP request.prepareBody
(HttpMessage message) prepareHeaders
(HttpMessage message) default String
preparePort
(HttpRequest request)
-
Method Details
-
format
- Specified by:
format
in interfaceHttpLogFormatter
- Throws:
IOException
-
format
- Specified by:
format
in interfaceHttpLogFormatter
- Throws:
IOException
-
format
Renders properties of an HTTP message into a JSON string.- Parameters:
content
- individual parts of an HTTP message- Returns:
- the whole message as a JSON object
- Throws:
IOException
- if writing JSON output fails- See Also:
-
prepare
default Map<String,Object> prepare(Precorrelation precorrelation, HttpRequest request) throws IOException Produces a map of individual properties from an HTTP request.- Parameters:
precorrelation
- the correlationrequest
- the request- Returns:
- a map containing HTTP request attributes
- Throws:
IOException
- if reading body fails- See Also:
-
prepare
default Map<String,Object> prepare(Correlation correlation, HttpResponse response) throws IOException Produces a map of individual properties from an HTTP response.- Parameters:
correlation
- the correlationresponse
- the response- Returns:
- a map containing HTTP response attributes
- Throws:
IOException
- if reading body fails- See Also:
-
preparePort
-
prepareHeaders
-
prepareBody
- Throws:
IOException
-