Package org.zalando.logbook
Class DefaultHttpLogFormatter
- java.lang.Object
-
- org.zalando.logbook.DefaultHttpLogFormatter
-
- All Implemented Interfaces:
HttpLogFormatter
@API(status=STABLE) public final class DefaultHttpLogFormatter extends Object implements HttpLogFormatter
-
-
Constructor Summary
Constructors Constructor Description DefaultHttpLogFormatter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringformat(Correlation correlation, HttpResponse response)Produces an HTTP-like request in individual lines.Stringformat(Precorrelation precorrelation, HttpRequest request)Produces an HTTP-like request in individual lines.
-
-
-
Method Detail
-
format
public String format(Precorrelation precorrelation, HttpRequest request) throws IOException
Produces an HTTP-like request in individual lines.- Specified by:
formatin interfaceHttpLogFormatter- Parameters:
precorrelation- the request correlationrequest- the HTTP request- Returns:
- a line-separated HTTP request
- Throws:
IOException- if reading body fails
-
format
public String format(Correlation correlation, HttpResponse response) throws IOException
Produces an HTTP-like request in individual lines.- Specified by:
formatin interfaceHttpLogFormatter- Parameters:
correlation- the request correlation- Returns:
- a line-separated HTTP request
- Throws:
IOException- if reading body fails- See Also:
StructuredHttpLogFormatter.prepare(Precorrelation, HttpRequest)
-
-