summaryrefslogtreecommitdiffstats
path: root/rest-services
diff options
context:
space:
mode:
authorPiotr Wielebski <piotr.wielebski@nokia.com>2019-03-19 21:01:59 +0000
committerGerrit Code Review <gerrit@onap.org>2019-03-19 21:01:59 +0000
commit99fa950dabd3be4c0f0279d85ad56c896e07370f (patch)
tree46262b90d233469476496f6906c5332e7a0b95c6 /rest-services
parent9b03823dc6ac4bec2e61a4e54d114a518dbb1100 (diff)
parente9af6690e91f3df016fe75d414e8ee3d55c55244 (diff)
Merge "Add logging to CLoud Http Client debug"
Diffstat (limited to 'rest-services')
-rw-r--r--rest-services/common-dependency/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/adapters/http/CloudHttpClient.java6
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())