diff options
author | Tian Lee <TianL@amdocs.com> | 2017-09-25 09:07:43 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-25 09:07:43 +0000 |
commit | 8dc0886bb8cab699ccebe551ed61f38c500c6699 (patch) | |
tree | d67d0f8a00bda092b1e4019635f1f40c1a18150a /ajsc-aai/src | |
parent | 268e8dabb8a67ce3a86ad077065006ac7793e6e0 (diff) | |
parent | e053ec4b6e7b4f214087d7d6d107055103cbc442 (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.java | 14 |
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"); |