From 1f3fb927caed1f951f8c65f58623549c73121191 Mon Sep 17 00:00:00 2001 From: GOPINATH MATHIVANAN Date: Tue, 4 Sep 2018 12:57:51 +0530 Subject: fixing Sonar reported log issue Fixed Sonar reported vulnerability in LoggerStartupListener Issue-ID: SO-962 Change-Id: Icc82d8de94c8ea3c4cd27133e833e2d499e8670d Signed-off-by: GOPINATH MATHIVANAN --- common/src/main/java/org/onap/so/logger/LoggerStartupListener.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/org/onap/so/logger/LoggerStartupListener.java b/common/src/main/java/org/onap/so/logger/LoggerStartupListener.java index 0d20dd8bf9..1ed18eae0f 100644 --- a/common/src/main/java/org/onap/so/logger/LoggerStartupListener.java +++ b/common/src/main/java/org/onap/so/logger/LoggerStartupListener.java @@ -15,6 +15,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. + * Modifications Copyright (C) 2018 IBM. * ============LICENSE_END========================================================= */ @@ -23,6 +24,7 @@ package org.onap.so.logger; import java.net.InetAddress; import java.net.UnknownHostException; +import org.onap.so.utils.UUIDChecker; import org.springframework.stereotype.Component; import ch.qos.logback.classic.Level; @@ -37,6 +39,7 @@ import ch.qos.logback.core.spi.LifeCycle; public class LoggerStartupListener extends ContextAwareBase implements LoggerContextListener, LifeCycle { private boolean started = false; + private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL, LoggerStartupListener.class); @Override public void start() { @@ -46,7 +49,8 @@ public class LoggerStartupListener extends ContextAwareBase implements LoggerCon try { addr = InetAddress.getLocalHost(); } catch (UnknownHostException e) { - e.printStackTrace(); + LOGGER.error("UnknownHostException",e); + } Context context = getContext(); if (addr != null) { -- cgit 1.2.3-korg