From 9d6aea2f8b0edb2a6bb3d6fb449148a096e43a76 Mon Sep 17 00:00:00 2001 From: Shadi Haidar Date: Fri, 13 Jul 2018 11:26:29 -0400 Subject: InventoryAPI Syncup with ECOMP Logging Issue-ID: DCAEGEN2-575 Change-Id: I9df025e3f8ddeb282f980758bdf1dc30491e0d01 Signed-off-by: Shadi Haidar --- .../onap/dcae/inventory/exceptions/mappers/DBIExceptionMapper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/org/onap/dcae/inventory/exceptions/mappers') diff --git a/src/main/java/org/onap/dcae/inventory/exceptions/mappers/DBIExceptionMapper.java b/src/main/java/org/onap/dcae/inventory/exceptions/mappers/DBIExceptionMapper.java index fb16a51..f461d26 100644 --- a/src/main/java/org/onap/dcae/inventory/exceptions/mappers/DBIExceptionMapper.java +++ b/src/main/java/org/onap/dcae/inventory/exceptions/mappers/DBIExceptionMapper.java @@ -42,7 +42,7 @@ import javax.ws.rs.ext.ExceptionMapper; */ public class DBIExceptionMapper implements ExceptionMapper { - private static final Logger LOG = LoggerFactory.getLogger(DBIExceptionMapper.class); + private final static Logger errorLogger = LoggerFactory.getLogger("errorLogger"); /** * Upon a DBIException, this handler will attempt to re-initialize the Inventory's database connection @@ -53,14 +53,14 @@ public class DBIExceptionMapper implements ExceptionMapp */ @Override public Response toResponse(T exception) { - LOG.error("", exception); + errorLogger.error("", exception); StringBuilder clientMessage = new StringBuilder("There is a database issue."); try { InventoryDAOManager.getInstance().initialize(); clientMessage.append(" Connection has been successfully reset. Please try again."); } catch(Exception e) { - LOG.error(String.format("Failed to re-initialize database connection: %s", e)); + errorLogger.error(String.format("Failed to re-initialize database connection: %s", e.getMessage())); clientMessage.append(" Connection reset attempt has failed. Please try again soon."); } -- cgit 1.2.3-korg