aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-common
diff options
context:
space:
mode:
authorRob Daugherty <rd472p@att.com>2018-08-10 17:37:43 +0000
committerGerrit Code Review <gerrit@onap.org>2018-08-10 17:37:43 +0000
commita6ed83b5ad7340dd8f6c642abe965423bdaa8f43 (patch)
tree1b800bd0a3c47e4ff0a81877ef156704e1c782a8 /mso-api-handlers/mso-api-handler-common
parentbe7ff879c9ad8bd049f5dad55a3984c154b69ddb (diff)
parent80da6ea3e2867b462e0007b9337e97fd5cc38816 (diff)
Merge "Improve Logging"
Diffstat (limited to 'mso-api-handlers/mso-api-handler-common')
-rw-r--r--mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapper.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapper.java b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapper.java
index e0bcc71736..0e581cb48a 100644
--- a/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapper.java
+++ b/mso-api-handlers/mso-api-handler-common/src/main/java/org/onap/so/apihandlerinfra/exceptions/ApiExceptionMapper.java
@@ -63,7 +63,7 @@ public class ApiExceptionMapper implements ExceptionMapper<ApiException> {
errorText = errorText.substring(0, 1999);
}
- writeErrorLog(errorText, errorLoggerInfo, alarmLoggerInfo);
+ writeErrorLog(exception, errorText, errorLoggerInfo, alarmLoggerInfo);
return buildServiceErrorResponse(errorText,messageId,variables);
@@ -96,8 +96,9 @@ public class ApiExceptionMapper implements ExceptionMapper<ApiException> {
return requestErrorStr;
}
- protected void writeErrorLog(String errorText, ErrorLoggerInfo errorLogInfo, AlarmLoggerInfo alarmLogInfo) {
-
+ protected void writeErrorLog(Exception e, String errorText, ErrorLoggerInfo errorLogInfo, AlarmLoggerInfo alarmLogInfo) {
+ if( e!= null)
+ logger.error(e);
if(errorLogInfo != null)
logger.error(errorLogInfo.getLoggerMessageType().toString(), errorLogInfo.getErrorSource(), errorLogInfo.getTargetEntity(), errorLogInfo.getTargetServiceName(), errorLogInfo.getErrorCode(), errorText);
if(alarmLogInfo != null){