BAEL 1756 (#4263) - Review comments incorporated
This commit is contained in:
parent
1e3b3f27a4
commit
488b449253
|
@ -22,20 +22,18 @@ public class RestTemplateLoggingInterceptor implements ClientHttpRequestIntercep
|
||||||
}
|
}
|
||||||
|
|
||||||
private void logRequest(byte[] body) {
|
private void logRequest(byte[] body) {
|
||||||
String payLoad = StringUtils.EMPTY;
|
|
||||||
if (body.length > 0) {
|
if (body.length > 0) {
|
||||||
payLoad = new String(body, StandardCharsets.UTF_8);
|
String payLoad = new String(body, StandardCharsets.UTF_8);
|
||||||
|
System.out.println(payLoad);
|
||||||
}
|
}
|
||||||
System.out.println("Request Body > " + payLoad);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void logResponse(ClientHttpResponse response) throws IOException {
|
private void logResponse(ClientHttpResponse response) throws IOException {
|
||||||
String payLoad = StringUtils.EMPTY;
|
|
||||||
long contentLength = response.getHeaders()
|
long contentLength = response.getHeaders()
|
||||||
.getContentLength();
|
.getContentLength();
|
||||||
if (contentLength != 0) {
|
if (contentLength != 0) {
|
||||||
payLoad = StreamUtils.copyToString(response.getBody(), StandardCharsets.UTF_8);
|
String payLoad = StreamUtils.copyToString(response.getBody(), StandardCharsets.UTF_8);
|
||||||
|
System.out.println(payLoad);
|
||||||
}
|
}
|
||||||
System.out.println("Response Body > " + payLoad);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue