From b42284e190f3c7f3492e9b29aae49d1a0ef9940c Mon Sep 17 00:00:00 2001 From: Yoshani Ranaweera <46979289+Yoshani@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:38:31 +0530 Subject: [PATCH] Revert "[Temporary Fix] Remove debug logs" --- .../notification/util/NotificationUtil.java | 60 ++++++++----------- 1 file changed, 25 insertions(+), 35 deletions(-) diff --git a/components/event-handler-notification/org.wso2.carbon.identity.event.handler.notification/src/main/java/org/wso2/carbon/identity/event/handler/notification/util/NotificationUtil.java b/components/event-handler-notification/org.wso2.carbon.identity.event.handler.notification/src/main/java/org/wso2/carbon/identity/event/handler/notification/util/NotificationUtil.java index 06bce9f3..74ed170b 100644 --- a/components/event-handler-notification/org.wso2.carbon.identity.event.handler.notification/src/main/java/org/wso2/carbon/identity/event/handler/notification/util/NotificationUtil.java +++ b/components/event-handler-notification/org.wso2.carbon.identity.event.handler.notification/src/main/java/org/wso2/carbon/identity/event/handler/notification/util/NotificationUtil.java @@ -238,22 +238,16 @@ public static Map getPlaceholderValues(EmailTemplate emailTempla .equals(e.getErrorCode())) { brandingPreferences = null; } else { - // if (log.isDebugEnabled()) { - // String message = - // "Error occurred while retrieving branding preferences for organization " + - // placeHolderData.get(TENANT_DOMAIN); - // log.debug(message, e); - // } - // Ignore + if (log.isDebugEnabled()) { + String message = "Error occurred while retrieving branding preferences for organization " + placeHolderData.get(TENANT_DOMAIN); + log.debug(message, e); + } } } catch (Exception e) { - // if (log.isDebugEnabled()) { - // String message = - // "Error occurred while retrieving branding preferences for organization " + placeHolderData - // .get(TENANT_DOMAIN); - // log.debug(message, e); - // } - // Ignore + if (log.isDebugEnabled()) { + String message = "Error occurred while retrieving branding preferences for organization " + placeHolderData.get(TENANT_DOMAIN); + log.debug(message, e); + } } } @@ -385,27 +379,25 @@ public static String getCopyrightPlaceholderValueFromCustomTexts(String tenantDo } catch (BrandingPreferenceMgtException e) { if (BrandingPreferenceMgtConstants.ErrorMessages.ERROR_CODE_CUSTOM_TEXT_PREFERENCE_NOT_EXISTS.getCode() .equals(e.getErrorCode())) { - // if (log.isDebugEnabled()) { - // String message = "Custom text preferences are not configured for the organization: " - // + tenantDomain + " with locale: " + locale; - // log.debug(message, e); - // } + if (log.isDebugEnabled()) { + String message = "Custom text preferences are not configured for the organization: " + + tenantDomain + " with locale: " + locale; + log.debug(message, e); + } customTextPreference = null; } else { - // if (log.isDebugEnabled()) { - // String message = "Error occurred while retrieving custom text preferences for organization " - // + tenantDomain; - // log.debug(message, e); - // } - // Ignore + if (log.isDebugEnabled()) { + String message = "Error occurred while retrieving custom text preferences for organization " + + tenantDomain; + log.debug(message, e); + } } } catch (Exception e) { - // if (log.isDebugEnabled()) { - // String message = "Error occurred while retrieving custom text preferences for organization " - // + tenantDomain; - // log.debug(message, e); - // } - // Ignore + if (log.isDebugEnabled()) { + String message = "Error occurred while retrieving custom text preferences for organization " + + tenantDomain; + log.debug(message, e); + } } if (customTextPreference != null) { @@ -722,12 +714,10 @@ public static Notification buildNotification(Event event, Map pl .getApplicationBasicInfoByName(applicationName, applicationDomain) .getApplicationResourceId(); } catch (IdentityApplicationManagementException | NullPointerException e) { - // log.debug("Fallback to organization preference. Error fetching application id for application name: " + applicationName, e); - // ignore + log.debug("Fallback to organization preference. Error fetching application id for application name: " + applicationName, e); } } else { - // log.debug("Fallback to organization preference. Cannot get application id or application name from the event"); - // ignore + log.debug("Fallback to organization preference. Cannot get application id or application name from the event"); } emailTemplateExists = NotificationHandlerDataHolder.getInstance().getEmailTemplateManager()