summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/commons/rest-lib
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2019-10-31 12:59:17 +0000
committerGerrit Code Review <gerrit@onap.org>2019-10-31 12:59:17 +0000
commitbfad46ffc8078b6fe2c8ea382daf9f8f795be4b7 (patch)
tree9cd8e4d822bec01f901af1ff50c8680c47ea00af /ms/blueprintsprocessor/modules/commons/rest-lib
parentb3f56638d438107a201466c1956240805f100889 (diff)
parent0d3a0223fd11d431497519f3f9da640aafe00460 (diff)
Merge "Add Message tracing logger service."
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/rest-lib')
-rw-r--r--ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/rest/service/RestLoggerService.kt4
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)
}