diff options
author | Luke Parker <lparker@amdocs.com> | 2018-06-19 23:35:33 +1000 |
---|---|---|
committer | Luke Parker <lparker@amdocs.com> | 2018-06-19 23:35:33 +1000 |
commit | bca830c8ee8cc574bd3f05e0599c56d05ba011e2 (patch) | |
tree | cbc2de21009e88e0e852b1baad56c8cf972e683e /reference/logging-slf4j/src/main/java | |
parent | f78f68dc817cbbf76f2d65e68c955f0ec3e65d2d (diff) |
Change MDC datetime formatter to Zulu time
Change-Id: I0e771e0ec10d1972290c44e8e0740309ac83bc52
Signed-off-by: Luke Parker <lparker@amdocs.com>
Issue-ID: LOG-115
Diffstat (limited to 'reference/logging-slf4j/src/main/java')
-rw-r--r-- | reference/logging-slf4j/src/main/java/org/onap/logging/ref/slf4j/ONAPLogAdapter.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/reference/logging-slf4j/src/main/java/org/onap/logging/ref/slf4j/ONAPLogAdapter.java b/reference/logging-slf4j/src/main/java/org/onap/logging/ref/slf4j/ONAPLogAdapter.java index 50693cb..d26cd13 100644 --- a/reference/logging-slf4j/src/main/java/org/onap/logging/ref/slf4j/ONAPLogAdapter.java +++ b/reference/logging-slf4j/src/main/java/org/onap/logging/ref/slf4j/ONAPLogAdapter.java @@ -21,7 +21,9 @@ package org.onap.logging.ref.slf4j; -import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; import java.util.UUID; import javax.servlet.http.HttpServletRequest; @@ -315,7 +317,9 @@ public class ONAPLogAdapter { // depending on where you need them to appear, OR extend the // ServiceDescriptor to add them. - MDC.put(ONAPLogConstants.MDCs.INVOKE_TIMESTAMP, LocalDateTime.now().toString()); + MDC.put(ONAPLogConstants.MDCs.INVOKE_TIMESTAMP, + ZonedDateTime.now(ZoneOffset.UTC) + .format(DateTimeFormatter.ISO_INSTANT)); MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, requestID); MDC.put(ONAPLogConstants.MDCs.INVOCATION_ID, invocationID); MDC.put(ONAPLogConstants.MDCs.PARTNER_NAME, partnerName); |