From 8a4b71366943aac8e937dd4aa2b73c888b7fa700 Mon Sep 17 00:00:00 2001 From: Sreerag K S <58926794+sreeragksgh@users.noreply.github.com> Date: Wed, 29 May 2024 15:30:38 +0530 Subject: [PATCH] Adding logs to analyse OTP generation API 5xx issue in production (#577) * Adding logs to analyse OTP generation API 5xx issue in production * Review comments updated --- .../user/registration/service/UserRegistrationServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/sunbird/user/registration/service/UserRegistrationServiceImpl.java b/src/main/java/org/sunbird/user/registration/service/UserRegistrationServiceImpl.java index 1d28b0ae8..d929c9c2f 100644 --- a/src/main/java/org/sunbird/user/registration/service/UserRegistrationServiceImpl.java +++ b/src/main/java/org/sunbird/user/registration/service/UserRegistrationServiceImpl.java @@ -205,6 +205,7 @@ public SBApiResponse generateOTP(Map otpRequests) { Map apiResponse = outboundRequestHandlerService.fetchResultUsingPost(url, otpRequests, headers); if (Constants.OK.equalsIgnoreCase((String) apiResponse.get(Constants.RESPONSE_CODE))) { + LOGGER.info("OTP Generation successful"); response.setVer("v1"); response.getParams().setStatus(Constants.SUCCESS.toUpperCase()); response.getParams().setResmsgid(UUID.randomUUID().toString()); @@ -220,6 +221,7 @@ public SBApiResponse generateOTP(Map otpRequests) { } } if (StringUtils.isNotBlank(errMsg)) { + LOGGER.error("OTP generation request failed, error message : ",errMsg); response.getParams().setStatus(Constants.FAILED); response.getParams().setErrmsg(errMsg); response.setResponseCode(HttpStatus.INTERNAL_SERVER_ERROR);