aboutsummaryrefslogtreecommitdiffstats
path: root/ajsc-aai/src
diff options
context:
space:
mode:
authorTian Lee <TianL@amdocs.com>2017-09-25 09:07:43 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-25 09:07:43 +0000
commit8dc0886bb8cab699ccebe551ed61f38c500c6699 (patch)
treed67d0f8a00bda092b1e4019635f1f40c1a18150a /ajsc-aai/src
parent268e8dabb8a67ce3a86ad077065006ac7793e6e0 (diff)
parente053ec4b6e7b4f214087d7d6d107055103cbc442 (diff)
Merge "Add RequestId and PartnerName in log"
Diffstat (limited to 'ajsc-aai/src')
-rw-r--r--ajsc-aai/src/main/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptor.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/ajsc-aai/src/main/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptor.java b/ajsc-aai/src/main/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptor.java
index b0e1742..448f8b9 100644
--- a/ajsc-aai/src/main/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptor.java
+++ b/ajsc-aai/src/main/java/org/openecomp/aai/interceptors/AAILogJAXRSInInterceptor.java
@@ -48,6 +48,7 @@ import org.openecomp.aai.rest.util.EchoResponse;
import org.openecomp.aai.util.AAIConfig;
import org.openecomp.aai.util.AAIConstants;
import org.openecomp.aai.util.HbaseSaltPrefixer;
+import org.slf4j.MDC;
public class AAILogJAXRSInInterceptor extends JAXRSInInterceptor {
@@ -221,14 +222,19 @@ 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> fa = headersList.get("X-FromAppId");
- if (fa != null) {
- for (String fromAppIdValue : fa) {
+ List<String> fromAppIdList = headersList.get("X-FromAppId");
+ if (fromAppIdList != null) {
+ for (String fromAppIdValue : fromAppIdList) {
fromAppId = fromAppIdValue;
}
+ MDC.put("PartnerName",fromAppId);
}
List<String> contentType = headersList.get("Content-Type");