From be4b713c7bd80ac0ac98f3f1ea8bc8f477dcb3e2 Mon Sep 17 00:00:00 2001 From: Jozsef Csongvai Date: Tue, 7 Jun 2022 19:30:54 -0400 Subject: Improve log format consistency Logs related to request processing should include: requestId, subrequestId and originatorId. Each API (rest,grpc,kafka) would produce different outputs, due to MDC context not being passed properly between coroutine contexts or values not being populated. Issue-ID: CCSDK-3686 Signed-off-by: Jozsef Csongvai Change-Id: Ibafdffd3409b9724ad91633ca5840070f7e287f5 --- .../ccsdk/cds/blueprintsprocessor/rest/service/RestLoggerService.kt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ms/blueprintsprocessor/modules/commons/rest-lib') diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestLoggerService.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestLoggerService.kt index b1d8abd16..4b9bbb19f 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestLoggerService.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestLoggerService.kt @@ -126,6 +126,8 @@ suspend fun mdcWebCoroutineScope( val mdcContext = if (executionServiceInput != null) { // MDC Context with overridden request ID MDC.put("RequestID", executionServiceInput.commonHeader.requestId) + MDC.put("SubRequestID", executionServiceInput.commonHeader.subRequestId) + MDC.put("OriginatorID", executionServiceInput.commonHeader.originatorId) MDCContext(MDC.getCopyOfContextMap()) } else { // Default MDC Context -- cgit 1.2.3-korg