You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Daniel Marcotte (JIRA)" <ji...@apache.org> on 2016/01/06 16:26:40 UTC
[jira] [Created] (LOG4J2-1246) The PatternLayout for ISO-ISO8601
doesn't seem to properly handle the Timezone
Daniel Marcotte created LOG4J2-1246:
---------------------------------------
Summary: The PatternLayout for ISO-ISO8601 doesn't seem to properly handle the Timezone
Key: LOG4J2-1246
URL: https://issues.apache.org/jira/browse/LOG4J2-1246
Project: Log4j 2
Issue Type: Bug
Components: Pattern Converters
Reporter: Daniel Marcotte
Fix For: 2.4.1
Hi there!
There might be a small issue with the Pattern Converters regarding Timezone management: http://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout
Right now, these patterns:
* {code}"%d{ISO8601_BASIC}"{code}
* {code}"%d{ISO8601_BASIC}{UTC}"{code}
Give the same results:
* {code}20160104T204256,048{code}
* {code}20160104T204256,048{code}
However, with a deeper look at the ISO-8601 standards, the second one with {code}"{UTC}"{code} should properly add the Timezone at the end of the timestamp.
Reference: https://en.wikipedia.org/wiki/ISO_8601#Times
{quote}
*UTC*
If the time is in UTC, add a Z directly after the time without a space. Z is the zone designator for the zero UTC offset. "09:30 UTC" is therefore represented as "09:30Z" or "0930Z". "14:45:15 UTC" would be "14:45:15Z" or "144515Z".
UTC time is also known as 'Zulu' time, since 'Zulu' is the NATO phonetic alphabet word for 'Z'.
*Examples*
<time>Z
<time>±hh:mm
<time>±hhmm
<time>±hh
{quote}
As of ISO-8601, the results should be one of the following (configurable?):
* {code}20160104T204256,048Z{code}
* {code}20160104T204256,048+00:00{code}
* {code}20160104T204256,048+0000{code}
* {code}20160104T204256,048+00{code}
Another reference: http://stackoverflow.com/questions/833102/wheres-the-datetime-z-format-specifier
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org