diff options
author | Marcin Migdal <marcin.migdal@nokia.com> | 2019-03-19 15:21:20 +0100 |
---|---|---|
committer | Marcin Migdal <marcin.migdal@nokia.com> | 2019-03-19 15:21:20 +0100 |
commit | e9af6690e91f3df016fe75d414e8ee3d55c55244 (patch) | |
tree | 1600c05e64ec3d1e0392aecdb5fd91efe06454d4 | |
parent | e797ed3347d2c6d5ee8af16c33aca45fe42eb2ce (diff) |
Add logging to CLoud Http Client debug
Change-Id: Ibc6f96016a6f3df5682793911c228e3c5e6b0cd8
Issue-ID: DCAEGEN2-1310
Signed-off-by: mmigdal <marcin.migdal@nokia.com>
Signed-off-by: Marcin Migdal <marcin.migdal@nokia.com>
-rw-r--r-- | rest-services/common-dependency/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/adapters/http/CloudHttpClient.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rest-services/common-dependency/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/adapters/http/CloudHttpClient.java b/rest-services/common-dependency/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/adapters/http/CloudHttpClient.java index 596c6614..ac790cb2 100644 --- a/rest-services/common-dependency/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/adapters/http/CloudHttpClient.java +++ b/rest-services/common-dependency/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/adapters/http/CloudHttpClient.java @@ -121,8 +121,10 @@ public class CloudHttpClient { private <T extends ClientModel> Mono<HttpClientResponse> callHttpPatch(HttpClient client, String url, JsonBodyBuilder<T> jsonBodyBuilder, T clientModel) { + String jsonBodyRequest = jsonBodyBuilder.createJsonBody(clientModel); + LOGGER.debug( String.format("Json body request: %s ",jsonBodyRequest)); return client.baseUrl(url).patch() - .send(ByteBufFlux.fromString(Mono.just(jsonBodyBuilder.createJsonBody(clientModel)))) + .send(ByteBufFlux.fromString(Mono.just(jsonBodyRequest))) .responseSingle((httpClientResponse, byteBufMono) -> Mono.just(httpClientResponse)); } @@ -138,7 +140,7 @@ public class CloudHttpClient { private void logRequest(RequestDiagnosticContext context, HttpClientRequest httpClientRequest) { context.withSlf4jMdc(LOGGER.isDebugEnabled(), () -> { - LOGGER.debug("Request: {} {}", httpClientRequest.method(), httpClientRequest.uri()); + LOGGER.debug("Request: {} {} {}", httpClientRequest.method(), httpClientRequest.uri(), httpClientRequest.requestHeaders()); if (LOGGER.isTraceEnabled()) { final String headers = Stream.ofAll(httpClientRequest.requestHeaders()) .map(entry -> entry.getKey() + "=" + entry.getValue()) |