aboutsummaryrefslogtreecommitdiffstats
path: root/champ-service/src
diff options
context:
space:
mode:
authorStela Stoykova <Stela.Stoykova@amdocs.com>2019-05-27 14:57:34 -0400
committerStela Stoykova <Stela.Stoykova@amdocs.com>2019-05-27 15:35:33 -0400
commit8524acbca18540f589dcb9d8335e3cc67fb6e059 (patch)
tree606ac86e9f72125114cb7a658364437d46729fe6 /champ-service/src
parentd1a8f8ff686326708829e51878b8c87643ff91a9 (diff)
Updated champ-lib to use the correct logger
Issue-ID: AAI-2462 Signed-off-by: Stela Stoykova <Stela.Stoykova@amdocs.com> Change-Id: I4a8e544c6eb44c6a3db295787b37f8787eabd50f
Diffstat (limited to 'champ-service/src')
-rw-r--r--champ-service/src/main/java/org/onap/champ/ChampApplication.java5
-rw-r--r--champ-service/src/main/java/org/onap/champ/service/logging/LoggingUtil.java4
2 files changed, 9 insertions, 0 deletions
diff --git a/champ-service/src/main/java/org/onap/champ/ChampApplication.java b/champ-service/src/main/java/org/onap/champ/ChampApplication.java
index 1f1fa3c..bb0a448 100644
--- a/champ-service/src/main/java/org/onap/champ/ChampApplication.java
+++ b/champ-service/src/main/java/org/onap/champ/ChampApplication.java
@@ -22,8 +22,11 @@ package org.onap.champ;
import java.util.HashMap;
import java.util.Map;
+
import javax.annotation.PostConstruct;
+
import org.eclipse.jetty.util.security.Password;
+import org.onap.champ.service.logging.LoggingUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
@@ -39,6 +42,8 @@ public class ChampApplication extends SpringBootServletInitializer {
private Environment env;
public static void main(String[] args) {
+ LoggingUtil.initMdcContext();
+
String keyStorePassword = System.getProperty("KEY_STORE_PASSWORD");
if (keyStorePassword == null || keyStorePassword.isEmpty()) {
throw new RuntimeException("Environment property KEY_STORE_PASSWORD not set");
diff --git a/champ-service/src/main/java/org/onap/champ/service/logging/LoggingUtil.java b/champ-service/src/main/java/org/onap/champ/service/logging/LoggingUtil.java
index 17ac270..a99be4c 100644
--- a/champ-service/src/main/java/org/onap/champ/service/logging/LoggingUtil.java
+++ b/champ-service/src/main/java/org/onap/champ/service/logging/LoggingUtil.java
@@ -56,6 +56,10 @@ public class LoggingUtil {
MdcContext.initialize(transId, "ChampService", "", fromAppId, fromIp);
}
+
+ public static void initMdcContext() {
+ MdcContext.initialize("", "ChampService", "", "", "");
+ }
/**
* Logs the rest request.