From b10344bac3bd0c7423f0558936dccf37872b9d44 Mon Sep 17 00:00:00 2001 From: Chandan Ghosh Date: Wed, 5 Sep 2018 12:00:18 +0530 Subject: replaced stacktrace with error log Replaced stacktrace with error log. Reported in SonarQube. Issue-ID: MUSIC-129 Change-Id: I54626e3b8d80cf7242cd1e67b627aa73266f1e8d Signed-off-by: Chandan Ghosh --- src/main/java/org/onap/music/main/CronJobManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main/java/org') diff --git a/src/main/java/org/onap/music/main/CronJobManager.java b/src/main/java/org/onap/music/main/CronJobManager.java index 0344c4a1..4928044e 100644 --- a/src/main/java/org/onap/music/main/CronJobManager.java +++ b/src/main/java/org/onap/music/main/CronJobManager.java @@ -33,6 +33,9 @@ import javax.servlet.annotation.WebListener; import org.onap.music.datastore.PreparedQueryObject; import org.onap.music.eelf.logging.EELFLoggerDelegate; +import org.onap.music.eelf.logging.format.AppMessages; +import org.onap.music.eelf.logging.format.ErrorSeverity; +import org.onap.music.eelf.logging.format.ErrorTypes; import org.onap.music.exceptions.MusicLockingException; import org.onap.music.exceptions.MusicServiceException; @@ -55,7 +58,7 @@ public class CronJobManager implements ServletContextListener { try { ResultType result = MusicCore.nonKeyRelatedPut(pQuery, consistency); } catch (MusicServiceException e1) { - e1.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger, e1.getMessage(),ErrorSeverity.ERROR); } //Zookeeper cleanup @@ -102,7 +105,7 @@ public class CronJobManager implements ServletContextListener { CachingUtil.deleteKeysFromDB(deleteKeys.toString()); } } catch (MusicServiceException e) { - e.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(),ErrorSeverity.ERROR); } } -- cgit 1.2.3-korg