diff options
author | 2019-10-28 16:46:47 -0400 | |
---|---|---|
committer | 2019-10-28 16:46:47 -0400 | |
commit | 0d3a0223fd11d431497519f3f9da640aafe00460 (patch) | |
tree | 8f211b811e86ebf72d4873957624ded94206d7c9 /ms/blueprintsprocessor/modules/commons/rest-lib/src/main | |
parent | 6885f5811c515d00c049c87de0797076dfc3686e (diff) |
Add Message tracing logger service.
Issue-ID: CCSDK-1046
Signed-off-by: Brinda Santh <bs2796@att.com>
Change-Id: I509df82ec558cd96934043a5b41ea53aa040cc81
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/rest-lib/src/main')
-rw-r--r-- | ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestLoggerService.kt | 4 |
1 files changed, 3 insertions, 1 deletions
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 2ef5a31bc..cec11ae3c 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 @@ -32,6 +32,7 @@ import org.springframework.http.server.reactive.ServerHttpResponse import reactor.core.Disposable import reactor.core.publisher.Mono import reactor.core.publisher.MonoSink +import java.net.InetAddress import java.time.ZoneOffset import java.time.ZonedDateTime import java.time.format.DateTimeFormatter @@ -43,6 +44,7 @@ class RestLoggerService { fun entering(request: ServerHttpRequest) { + val localhost = InetAddress.getLocalHost() val headers = request.headers val requestID = headers.getFirst(ONAP_REQUEST_ID).defaultToUUID() val invocationID = headers.getFirst(ONAP_INVOCATION_ID).defaultToUUID() @@ -52,7 +54,7 @@ class RestLoggerService { MDC.put("InvocationID", invocationID) MDC.put("PartnerName", partnerName) MDC.put("ClientIPAddress", request.remoteAddress?.address?.hostAddress.defaultToEmpty()) - MDC.put("ServerFQDN", request.remoteAddress?.hostString.defaultToEmpty()) + MDC.put("ServerFQDN",localhost.hostName.defaultToEmpty()) if (MDC.get("ServiceName") == null || MDC.get("ServiceName").equals("", ignoreCase = true)) { MDC.put("ServiceName", request.uri.path) } |