fixing Sonar reported log issue 45/64345/1
authorGOPINATH MATHIVANAN <gopinath.mathivanan@in.ibm.com>
Tue, 4 Sep 2018 07:27:51 +0000 (12:57 +0530)
committerGOPINATH MATHIVANAN <gopinath.mathivanan@in.ibm.com>
Tue, 4 Sep 2018 07:34:44 +0000 (13:04 +0530)
Fixed Sonar reported vulnerability in LoggerStartupListener

Issue-ID: SO-962
Change-Id: Icc82d8de94c8ea3c4cd27133e833e2d499e8670d
Signed-off-by: GOPINATH MATHIVANAN <gopinath.mathivanan@in.ibm.com>
common/src/main/java/org/onap/so/logger/LoggerStartupListener.java

index 0d20dd8..1ed18ea 100644 (file)
@@ -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) {