You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by "Ralph Goers (JIRA)" <ji...@apache.org> on 2017/07/18 18:33:00 UTC

[jira] [Comment Edited] (LOG4J2-1883) Timestamp does not seem to support microseconds level

    [ https://issues.apache.org/jira/browse/LOG4J2-1883?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16091963#comment-16091963 ] 

Ralph Goers edited comment on LOG4J2-1883 at 7/18/17 6:32 PM:
--------------------------------------------------------------

If we wanted to go the the trouble to create our own Instant class we could base the pre-java8 version on a long and improve it for java 8 and/or java 9. I'm not sure it is worth the effort to do that right now though.

FWIW, Premier support for Java 7 ends July 2019. I would expect we wouldn't drop support for Java 7 until then.


was (Author: ralph.goers@dslextreme.com):
If we wanted to go the the trouble to create our own Instant class we could base the pre-java8 version on a long and improve it for java 8 and/or java 9. I'm not sure it is worth the effort to do that right now though.

> 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.4.14#64029)