summaryrefslogtreecommitdiffstats
path: root/aai-resources
diff options
context:
space:
mode:
authorTian Lee <TianL@amdocs.com>2017-09-25 09:07:10 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-25 09:07:10 +0000
commit8150fb7fe9e51841cab99de991d04c6ca25ae457 (patch)
tree6563081fa72f60eafd8da4f436cb150a784ada7b /aai-resources
parent0e6adf5e9464573b814f85e8192972483678d3ee (diff)
parent62347fb521a81fca84c031a1c5bc9a60837eeada (diff)
Merge "Add RequestId and PartnerName in log"
Diffstat (limited to 'aai-resources')
-rw-r--r--aai-resources/src/main/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptor.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/aai-resources/src/main/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptor.java b/aai-resources/src/main/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptor.java
index 050283d..b1177f6 100644
--- a/aai-resources/src/main/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptor.java
+++ b/aai-resources/src/main/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptor.java
@@ -46,6 +46,7 @@ import org.openecomp.aai.util.HbaseSaltPrefixer;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
+import org.slf4j.MDC;
public class AAILogJAXRSInInterceptor extends JAXRSInInterceptor {
@@ -216,8 +217,21 @@ public class AAILogJAXRSInInterceptor extends JAXRSInInterceptor {
} else if (replacedTransId) {
logMsg = "Replaced invalid requestID of " + transId + " Assigned " + newTransId;
}
- }
-
+ MDC.put("RequestId",newTransId);
+ }
+ else {
+ MDC.put("RequestId",transId);
+ }
+
+ List<String> fromAppIdList = headersList.get("X-FromAppId");
+ if (fromAppIdList != null) {
+ String fromAppId = null;
+ for (String fromAppIdValue : fromAppIdList) {
+ fromAppId = fromAppIdValue;
+ }
+ MDC.put("PartnerName",fromAppId);
+ }
+
List<String> contentType = headersList.get("Content-Type");
if (contentType == null) {
ct = (String)message.get(Message.CONTENT_TYPE);