logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Marcotte (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1149) PatternLayout predefined date pattern with time zone always renders default date format
Date Mon, 04 Jan 2016 20:47:39 GMT

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

Daniel Marcotte commented on LOG4J2-1149:
-----------------------------------------

Hi [~remkop@yahoo.com], happy 2016! ;)

Sorry for popping out in this issue but I'm not 100% sure it's fixed (or maybe I'm wrong!)

I'm using 2.4.1 with this pattern: {code}"%d{ISO8601_BASIC}{UTC}"{code} but I still enter
this section of the FixedDateFormat
{code}
public static FixedDateFormat createIfSupported(final String... options) {
        if (options == null || options.length == 0 || options[0] == null) {
            return new FixedDateFormat(FixedFormat.DEFAULT);
        }
        // THIS STATEMENT IS EVALUATED TO TRUE --> WITH NO TIMEZONE SUPPORT
        if (options.length > 1) {
            return null; // time zone not supported
        }
        final FixedFormat type = FixedFormat.lookup(options[0]);
        return type == null ? null : new FixedDateFormat(type);
    }
{code}

I should have something like:
* 20160104T204256,048Z
But instead I have
* 20160104T204256,048

There's no "Z" in my format, meaning that I'm using local time (based on ISO-8601 https://en.wikipedia.org/wiki/ISO_8601#Times).
Do you any idea what's wrong?


> PatternLayout predefined date pattern with time zone always renders default date format
> ---------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-1149
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1149
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Pattern Converters
>    Affects Versions: 2.4
>            Reporter: Matt Barron
>            Assignee: Remko Popma
>             Fix For: 2.4.1
>
>
> The date pattern
> {code}
> "%d{ISO8601}{UTC}"
> {code}
> is rendered as the default date format (yyyy-MM-dd HH:mm:ss,SSS) instead.



--
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


Mime
View raw message