diff options
author | 2019-12-04 15:02:50 -0500 | |
---|---|---|
committer | 2019-12-04 15:58:39 -0500 | |
commit | ade7ef267161cb22cc2834e44dc6bde0597884f5 (patch) | |
tree | 302e903861919ea5a9eaa7a10a6c888333421d0b /reference/logging-filter/logging-filter-base/src/main/java/org/onap | |
parent | fbe7e0db7cc591990c379ac1516be7a4433fe01c (diff) |
Set InvocationID value from server and client invocationIds
Issue-ID: LOG-1189
Change-Id: I471b3f415546d8950f17b91b8d6ac4d415fed076
Signed-off-by: Brittany Plummer (bp896r) <bp896r@att.com>
Diffstat (limited to 'reference/logging-filter/logging-filter-base/src/main/java/org/onap')
3 files changed, 3 insertions, 0 deletions
diff --git a/reference/logging-filter/logging-filter-base/src/main/java/org/onap/logging/filter/base/AbstractAuditLogFilter.java b/reference/logging-filter/logging-filter-base/src/main/java/org/onap/logging/filter/base/AbstractAuditLogFilter.java index ce2f448..00285b6 100644 --- a/reference/logging-filter/logging-filter-base/src/main/java/org/onap/logging/filter/base/AbstractAuditLogFilter.java +++ b/reference/logging-filter/logging-filter-base/src/main/java/org/onap/logging/filter/base/AbstractAuditLogFilter.java @@ -52,6 +52,7 @@ public abstract class AbstractAuditLogFilter<GenericRequest, GenericResponse> ex protected void post(GenericResponse response) { try { + MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, MDC.get(ONAPLogConstants.MDCs.SERVER_INVOCATION_ID)); int responseCode = getResponseCode(response); setResponseStatusCode(responseCode); MDC.put(ONAPLogConstants.MDCs.RESPONSE_CODE, String.valueOf(responseCode)); diff --git a/reference/logging-filter/logging-filter-base/src/main/java/org/onap/logging/filter/base/AbstractMetricLogFilter.java b/reference/logging-filter/logging-filter-base/src/main/java/org/onap/logging/filter/base/AbstractMetricLogFilter.java index fabe8d2..16efdea 100644 --- a/reference/logging-filter/logging-filter-base/src/main/java/org/onap/logging/filter/base/AbstractMetricLogFilter.java +++ b/reference/logging-filter/logging-filter-base/src/main/java/org/onap/logging/filter/base/AbstractMetricLogFilter.java @@ -81,6 +81,7 @@ public abstract class AbstractMetricLogFilter<Request, Response, RequestHeaders> protected String setInvocationId() { String invocationId = UUID.randomUUID().toString(); MDC.put(ONAPLogConstants.MDCs.CLIENT_INVOCATION_ID, invocationId); + MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, invocationId); return invocationId; } diff --git a/reference/logging-filter/logging-filter-base/src/main/java/org/onap/logging/filter/base/MDCSetup.java b/reference/logging-filter/logging-filter-base/src/main/java/org/onap/logging/filter/base/MDCSetup.java index 70cb46d..d600a2c 100644 --- a/reference/logging-filter/logging-filter-base/src/main/java/org/onap/logging/filter/base/MDCSetup.java +++ b/reference/logging-filter/logging-filter-base/src/main/java/org/onap/logging/filter/base/MDCSetup.java @@ -114,6 +114,7 @@ public class MDCSetup { if (invocationId == null || invocationId.isEmpty()) invocationId = UUID.randomUUID().toString(); MDC.put(ONAPLogConstants.MDCs.SERVER_INVOCATION_ID, invocationId); + MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, invocationId); } public void setMDCPartnerName(SimpleMap headers) { |