You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Mikhail Lipkovich (JIRA)" <ji...@apache.org> on 2018/11/27 23:35:00 UTC

[jira] [Commented] (LOG4J2-1931) Wrong Date is calculated for rollover filePattern with timezone parameter

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

Mikhail Lipkovich commented on LOG4J2-1931:
-------------------------------------------

I'm having the same issue with the following config file with log4j 2.11.1 on Linux:
{code}
        <RollingFile name="File" fileName="${log-path}/app.log"
                     filePattern="${log-path}/app-%d{yyyy-MM-dd}{Europe/Moscow}.log">
            <PatternLayout pattern="%d{yyy-MM-dd HH:mm:ss.SSS}{Europe/Moscow} [%t] %-5level %logger{36} - %msg%n"/>
            <Policies>
                <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
            </Policies>
        </RollingFile>
{code}

Rolling occurs at 12am (UTC) instead of 12 am (Europe/Moscow)

> Wrong Date is calculated  for rollover filePattern with timezone parameter
> --------------------------------------------------------------------------
>
>                 Key: LOG4J2-1931
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1931
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.8.2
>         Environment: Windows 8
> Log4j2 2.8.2
>            Reporter: Arakha
>            Priority: Critical
>
> Wrong Date is calculated  for rollover filePattern with timezone parameter.
> Due to {{\{UTC+0}}}  calculated date is wrong. 
> current date is : 20170602 but the calculated one while rolling over is : 20170601 , file name: rollapp-20170601-1.log
> Configurations used are:
> {code:xml}
>    <RollingFile name="RollingFile" 
>     			 fileName="C:\temp\logs\2017-06-test\rollapp.log"
>                  filePattern="C:/temp/logs/${date:yyyy-MM}-test/rollapp-%d{yyyyMMdd}{UTC+0}-%i.log">
>       <PatternLayout>
>         <Pattern>%d{HH:mm:ss.SSS}{UTC+0}  %p %c{1.} [%t] %m%n</Pattern>
>       </PatternLayout>
>       <Policies>
>         <TimeBasedTriggeringPolicy />
>         <SizeBasedTriggeringPolicy size="1 MB"/>
>         
>       </Policies>
>     </RollingFile>
> {code}
> it may be related to fix done for : https://issues.apache.org/jira/browse/LOG4J2-1489



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)