Uploads
This commit is contained in:
+10
-1
@@ -3,6 +3,7 @@ package com.bayer.edam.migration.interceptors;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -26,11 +27,19 @@ public class LoggingRequestInterceptor implements ClientHttpRequestInterceptor {
|
||||
}
|
||||
|
||||
private void traceRequest(HttpRequest request, byte[] body) throws IOException {
|
||||
|
||||
String bodyRepresentation = null;
|
||||
|
||||
if (body.length > 1 && body[0] == '-' && body[1] == '-')
|
||||
bodyRepresentation = new String(Arrays.copyOfRange(body, 0, 32), "UTF-8");
|
||||
else
|
||||
bodyRepresentation = new String(body, "UTF-8");
|
||||
|
||||
log.debug("===================request begin===================");
|
||||
log.debug("URI : {}", request.getURI());
|
||||
log.debug("Method : {}", request.getMethod());
|
||||
log.debug("Headers : {}", request.getHeaders());
|
||||
log.debug("Request body: {}", new String(body, "UTF-8"));
|
||||
log.debug("Request body: {}", bodyRepresentation);
|
||||
log.debug("====================request end====================");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user