summaryrefslogtreecommitdiffstats
path: root/common-app-logging/src/main/java/org
diff options
context:
space:
mode:
authorSatoshi Fujii <fujii-satoshi@jp.fujitsu.com>2020-02-21 16:19:55 +0900
committerSatoshi Fujii <fujii-satoshi@jp.fujitsu.com>2020-02-21 16:24:07 +0900
commitc5411baf4fe1354e6a70742c9d2d33b6b5fdc12e (patch)
treeae978e8d1a1e8bf89927de8dfe8b09c06f38fadb /common-app-logging/src/main/java/org
parent32f485b151dba9e40e6b1171c246bf8f3e9c8fc4 (diff)
Fix logging date format to avoid parse error
When MDCSetup class in logging-filter-base tries to calculate an elapsed time, it expects a datetime is given in ISO format. But date format in LogFieldsMdcHandler is not compatible with ISO format therefore 'Unable to calculate elapsed time due to error' occurs. This change fixes date format in the class so that the date string can be parsed by logging-filter. Change-Id: I07c8f103f46493fe0764f904f3f00f66f35dbcf6 Issue-ID: SDC-2767 Signed-off-by: Satoshi Fujii <fujii-satoshi@jp.fujitsu.com>
Diffstat (limited to 'common-app-logging/src/main/java/org')
-rw-r--r--common-app-logging/src/main/java/org/openecomp/sdc/common/log/elements/LogFieldsMdcHandler.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/common-app-logging/src/main/java/org/openecomp/sdc/common/log/elements/LogFieldsMdcHandler.java b/common-app-logging/src/main/java/org/openecomp/sdc/common/log/elements/LogFieldsMdcHandler.java
index eb1646c612..3deb115f4b 100644
--- a/common-app-logging/src/main/java/org/openecomp/sdc/common/log/elements/LogFieldsMdcHandler.java
+++ b/common-app-logging/src/main/java/org/openecomp/sdc/common/log/elements/LogFieldsMdcHandler.java
@@ -27,7 +27,7 @@ public class LogFieldsMdcHandler implements ILogFieldsHandler {
return instanceMdcWrapper;
}
- private final static String dateFormatPattern = "yyyy-MM-dd HH:mm:ss.SSSz";
+ private final static String dateFormatPattern = "yyyy-MM-dd'T'HH:mm:ss.SSSz";
private final DateTimeFormatter dateTimeFormatter = DateTimeFormatter
.ofPattern(dateFormatPattern);
protected static Logger log = LoggerFactory.getLogger(LogFieldsMdcHandler.class.getName());
@@ -494,4 +494,4 @@ public class LogFieldsMdcHandler implements ILogFieldsHandler {
String requestId = LoggerBase.generateKeyRequestId();
LogFieldsMdcHandler.getInstance().setKeyRequestId(requestId);
}
-} \ No newline at end of file
+}