aboutsummaryrefslogtreecommitdiffstats
path: root/reference/logging-slf4j/src/main/java
diff options
context:
space:
mode:
authorMichael O'Brien <frank.obrien@amdocs.com>2018-06-19 16:01:41 +0000
committerGerrit Code Review <gerrit@onap.org>2018-06-19 16:01:41 +0000
commit9aaa8f39949d7dc3d66888797951a20a7bced145 (patch)
tree37decda452c2426ec4baadcc82588193cb918b53 /reference/logging-slf4j/src/main/java
parentf623a9882bfe2a3d2768f789223d430812569ee6 (diff)
parentbca830c8ee8cc574bd3f05e0599c56d05ba011e2 (diff)
Merge "Change MDC datetime formatter to Zulu time"
Diffstat (limited to 'reference/logging-slf4j/src/main/java')
-rw-r--r--reference/logging-slf4j/src/main/java/org/onap/logging/ref/slf4j/ONAPLogAdapter.java8
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);