}
} catch (Exception ex) {
- LOGGER.error("We were unable to create a rest exception to return on an API because of a parsing error", ex);
+ LOGGER.error("We were unable to create a rest exception to return on an API because of a parsing error " + ex.getMessage());
}
}
else {
response = (MapperUtil.writeAsJSONString((Object) restresp));
}
} catch (AAIException ex) {
- LOGGER.error("We were unable to create a rest exception to return on an API because of a parsing error", ex);
+ LOGGER.error("We were unable to create a rest exception to return on an API because of a parsing error " + ex.getMessage());
}
}
}
public static String getRESTAPIErrorResponseWithLogging(List<MediaType> acceptHeadersOrig, AAIException are, ArrayList<String> variables) {
String response = ErrorLogHelper.getRESTAPIErrorResponse(acceptHeadersOrig, are, variables);
- LOGGER.error(are.getMessage(), are);
+ LOGGER.error(are.getMessage() + " " + LogFormatTools.getStackTop(are));
return response;
}
responseMessages.getResponseMessage().add(responseMessage);
} catch (Exception ex) {
- LOGGER.error("We were unable to create a rest exception to return on an API because of a parsing error", ex);
+ LOGGER.error("We were unable to create a rest exception to return on an API because of a parsing error " + ex.getMessage());
}
}
}
} catch (Exception ex) {
- LOGGER.error("We were unable to create a rest exception to return on an API because of a parsing error", ex);
+ LOGGER.error("We were unable to create a rest exception to return on an API because of a parsing error "+ ex.getMessage());
}
return response;
}
LoggingContext.severity(sevCode);
}
}
-
+ String stackTrace = "";
+ try {
+ stackTrace = LogFormatTools.getStackTop(e);
+ }
+ catch (Exception a) {
+ //ignore
+ }
final String errorMessage = new StringBuilder()
.append(errorObject.getErrorText())
.append(":")
LoggingContext.responseDescription(errorMessage);
LoggingContext.statusCode(StatusCode.ERROR);
+ final String details = new StringBuilder().append(errorObject.getErrorCodeString())
+ .append(" ")
+ .append(stackTrace)
+ .toString();
+
if (errorObject.getSeverity().equalsIgnoreCase("WARN"))
- LOGGER.warn(errorMessage, e);
+ LOGGER.warn(details);
else if (errorObject.getSeverity().equalsIgnoreCase("ERROR"))
- LOGGER.error(errorMessage, e);
+ LOGGER.error(details);
else if (errorObject.getSeverity().equalsIgnoreCase("FATAL"))
- LOGGER.error(errorMessage, e);
+ LOGGER.error(details);
else if (errorObject.getSeverity().equals("INFO"))
- LOGGER.info(errorMessage + ", " + e.getMessage());
+ LOGGER.info(details);
}
public static void logError(String code) {