From 5d3e79de4241077e8ce4113933db792759440995 Mon Sep 17 00:00:00 2001 From: Mahesh Maney R <mahesh-maney@users.noreply.github.com> Date: Mon, 4 Sep 2023 16:36:15 +0530 Subject: [PATCH] adding loggers to debug <MAneyMR>. --- .../userManagement/utility/KeycloakUserUpdater.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/tarento/upsmf/userManagement/utility/KeycloakUserUpdater.java b/src/main/java/com/tarento/upsmf/userManagement/utility/KeycloakUserUpdater.java index 08d2168..fbbca13 100644 --- a/src/main/java/com/tarento/upsmf/userManagement/utility/KeycloakUserUpdater.java +++ b/src/main/java/com/tarento/upsmf/userManagement/utility/KeycloakUserUpdater.java @@ -59,17 +59,23 @@ public class KeycloakUserUpdater { StringEntity entity = new StringEntity(requestBody.toPrettyString()); httpPut.setEntity(entity); HttpResponse response = httpClient.execute(httpPut); - logger.info("Response after execution: {}",response); + logger.info("******** Response after execution: {} ********",response); String responseBody = ""; if(response.getEntity() != null) { + logger.info("******** Response Entity: {} ********",response.getEntity()); responseBody = EntityUtils.toString(response.getEntity()); } logger.info("ResponseBody {}", responseBody); + logger.info("response.getStatusLine().getStatusCode() {} ", response.getStatusLine().getStatusCode()); if (response.getStatusLine().getStatusCode() == 204) { if(requestBody.get("credentials")!=null){ + logger.info("credentials is not null"); ArrayNode credentials = (ArrayNode)requestBody.get("credentials"); + logger.info("credentials[] {}", credentials); if(!credentials.isEmpty() && !(credentials.get(0).get("value").asText().isBlank())) { - keycloakUserCredentialPersister.persistUserInfo(userName, credentials.get(0).get("value").asText()); + logger.info("userName : {}, credentials.get(0).get(\"value\").asText() : {}",userName, credentials.get(0).get("value").asText()); + String value = keycloakUserCredentialPersister.persistUserInfo(userName, credentials.get(0).get("value").asText()); + logger.info("persistUserInfo response {}", value); } } responseBody = " Status 200. User updated successfully."; -- GitLab