[
https://issues.apache.org/jira/browse/LOG4J2-1883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15976019#comment-15976019
]
chandra edited comment on LOG4J2-1883 at 4/20/17 3:53 AM:
----------------------------------------------------------
With all the discussion above, it is a good FYI on the topic but, I would still
argue on having a sub-millisecond accuracy of timestamp on the log. for any
real-time analysis (which I hope is the aim here) micorsecond level accuracy
won't give a precise time at which the event occurred. additionally as
[~Anthony Maire] has pointed out before until Java9 is out, there isn't a
standard way to do it even if needed.
For most practical implementations, millisecond accuracy is sufficient. Unless
it is in financial domain. [[email protected]] mind I asking what's your
requirement for using μs ?
was (Author: _chandra):
With all the discussion above, it is a good FYI on the topic but, I would still
argue on having a sub-millisecond accuracy of timestamp on the log. for any
real-time analysis (which I hope is the aim here) micorsecond level accuracy
won't give a precise time at which the event occurred. additionally as
[~Anthony Maire] has pointed out before Java9 is out, there isn't a standard
way to do it even if needed.
For most practical implementations, millisecond accuracy is sufficient. Unless
it is in financial domain. [[email protected]] mind I asking what's your
requirement for using μs ?
> Timestamp does not seem to support microseconds level
> -----------------------------------------------------
>
> Key: LOG4J2-1883
> URL: https://issues.apache.org/jira/browse/LOG4J2-1883
> Project: Log4j 2
> Issue Type: Bug
> Components: Configurators
> Environment: Linux with any JDK including JDK1.8
> Reporter: Madhava Dass
> Priority: Critical
>
> Used log4j and 'log4j2.xml' to configure timestamp format as:
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration status="WARN">
> <Appenders>
> <Console name="Console" target="SYSTEM_OUT">
> <PatternLayout
> pattern="[%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}{UTC}][%level][%logger{36}]:%msg%n"/>
> </Console>
> </Appenders>
> <Loggers>
> <Root level="DEBUG">
> <AppenderRef ref="Console"/>
> </Root>
> </Loggers>
> </Configuration>
> {code}
> This pattern produces the time stamp as:
> {code}
> [2017-03-29T13:55:28.363000][null]:[Thread-1]: - <message>
> {code}
> The desired output is:
> {code}
> [2017-03-29T13:55:28.363701-07:00][null]:[Thread-1]: - <message>
> {code}
> Different versions of JDKs were tried including JDK 1.8. It does not seem to
> make any difference in the outcome.
> Is there a way to get the desired time stamp through pattern matching
> configuration in the '*.xml' file?
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)