[
https://issues.apache.org/jira/browse/LOG4J2-1246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16710969#comment-16710969
]
Remko Popma commented on LOG4J2-1246:
-------------------------------------
Can we make these changes:
* Our javadoc should show an example of a resulting timestamp as it will appear
in the log file
* Can we rename our current constant names that end in X, XX or XXX to
something more meaningful? I propose using HH when the timezone offset is
rendered as {{+10}} (e.g. 2012-11-02'T'14:34:02,781+10), HHMM when the timezone
offset is rendered as {{+1000}} (e.g. 2012-11-02'T'14:34:02,781+1000) and HH_MM
when the timezone offset is rendered as {{+10:00}} (e.g.
2012-11-02'T'14:34:02,781+10:00)
* Can we remove the constant that ends in Z (ISO8601_OFFSET_DATE_TIME_Z and
FixedTimeZoneFormat.Z) to avoid confusion? Users are likely to assume that
these formats will render "Zulu time", that is, UTC time.
* Where our constant names have a DateTimeFormatter equivalent its Javadoc
should link to constant in DateTimeFormatter (I suspect only
ISO_OFFSET_DATE_TIME has an exact match in our constants)
> PatternLayout %date conversion pattern should render time zone designator for
> ISO-ISO8601
> -----------------------------------------------------------------------------------------
>
> Key: LOG4J2-1246
> URL: https://issues.apache.org/jira/browse/LOG4J2-1246
> Project: Log4j 2
> Issue Type: Bug
> Components: Pattern Converters
> Affects Versions: 2.4.1, 2.5
> Reporter: Daniel Marcotte
> Priority: Major
> Fix For: 2.11.2
>
>
> 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:
> * {{"%d\{ISO8601_BASIC\}}}
> * {{%d\{ISO8601_BASIC\}\{UTC\}}}
> Give the same results:
> * {{20160104T204256,048}}
> * {{20160104T204256,048}}
> However, with a deeper look at the ISO-8601 standards, the second one with
> {{"\{UTC\}"}} 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?):
> * {{20160104T204256,048Z}}
> * {{20160104T204256,048+00:00}}
> * {{20160104T204256,048+0000}}
> * {{20160104T204256,048+00}}
> Another reference:
> http://stackoverflow.com/questions/833102/wheres-the-datetime-z-format-specifier
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)