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 "Steven McCoy (JIRA)" <ji...@apache.org> on 2014/03/20 15:14:42 UTC

[jira] [Commented] (LOG4J2-572) FilePattern with year as date shows year+1

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

Steven McCoy commented on LOG4J2-572:
-------------------------------------

I believe this is due to the year being {{interval="12"}} from the Unix epoch but even then that is wrong should the next value not be 2018?

Noted verbose log output on startup:

{code}
2014-03-20 10:07:53,098 TRACE PatternProcessor.getNextTime returning 2016/01/01-00:00:00.000, nextFileTime=2015/01/01-00:00:00.000, prevFileTime=1969/12/31-19:00:00.000, freq=ANNUALLY
2014-03-20 10:07:53,099 TRACE PatternProcessor.getNextTime returning 2016/01/01-00:00:00.000, nextFileTime=2015/01/01-00:00:00.000, prevFileTime=2015/01/01-00:00:00.000, freq=ANNUALLY
{code}

Setting {{interval="1"}} yields the year 2014, setting "{{2}}" or "{{3}}" also yields 2015.

> FilePattern with year as date shows year+1
> ------------------------------------------
>
>                 Key: LOG4J2-572
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-572
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.0-rc1
>            Reporter: Steven McCoy
>            Priority: Minor
>
> The following basic configuration is showing 2015 not 2014:
> {code:xml}
> <RollingRandomAccessFile name="File" fileName="${filename}"
>         filePattern="logs/icap.log-%d{yy}.%i">
>       <PatternLayout pattern="%m%n"/>
>       <Policies>
>         <OnStartupTriggeringPolicy />
>         <TimeBasedTriggeringPolicy interval="12" modulate="true"/>
>       </Policies>
>     </RollingRandomAccessFile>
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org