diff --git a/g11n-ws/modules/md-restful-api-i18n/src/main/java/com/vmware/vip/core/except/ExceptionHandle.java b/g11n-ws/modules/md-restful-api-i18n/src/main/java/com/vmware/vip/core/except/ExceptionHandle.java index 54fa892e1..db776daa6 100644 --- a/g11n-ws/modules/md-restful-api-i18n/src/main/java/com/vmware/vip/core/except/ExceptionHandle.java +++ b/g11n-ws/modules/md-restful-api-i18n/src/main/java/com/vmware/vip/core/except/ExceptionHandle.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2023 VMware, Inc. + * Copyright 2019-2024 VMware, Inc. * SPDX-License-Identifier: EPL-2.0 */ package com.vmware.vip.core.except; @@ -70,7 +70,7 @@ public APIResponseDTO handler(Exception e) { } else { response.setResponse(new Response(APIResponseStatus.UNKNOWN_ERROR.getCode(), e.getMessage())); String errorStr = MessageFormat.format("unknown error: {0}" ,e.getMessage()); - logger.error(errorStr); + logger.error(errorStr, e); } String rstr = "[response] " + response.getResponse().toJSONString(); logger.info(rstr); diff --git a/g11n-ws/modules/md-restful-api-i18n/src/main/java/com/vmware/vip/i18n/api/base/BaseAction.java b/g11n-ws/modules/md-restful-api-i18n/src/main/java/com/vmware/vip/i18n/api/base/BaseAction.java index d08a4ac11..c3cbf96bd 100644 --- a/g11n-ws/modules/md-restful-api-i18n/src/main/java/com/vmware/vip/i18n/api/base/BaseAction.java +++ b/g11n-ws/modules/md-restful-api-i18n/src/main/java/com/vmware/vip/i18n/api/base/BaseAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2022 VMware, Inc. + * Copyright 2019-2024 VMware, Inc. * SPDX-License-Identifier: EPL-2.0 */ package com.vmware.vip.i18n.api.base; @@ -80,7 +80,7 @@ protected APIResponseDTO handleResponse(int code, String message, r.setMessage(message); r.setServerTime(LocalDateTime.now().toString()); d.setResponse(r); - if (logger.isDebugEnabled()) { + if (logger.isDebugEnabled() && d.getData() != null) { String logOfResData = "The response data: " + d.getData().toString(); logger.debug(logOfResData);