You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (Jira)" <ji...@apache.org> on 2021/03/10 15:35:00 UTC
[jira] [Closed] (LOG4J2-3039) RollingFileAppender ignores
TimeZone-Pattern
[ https://issues.apache.org/jira/browse/LOG4J2-3039?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ralph Goers closed LOG4J2-3039.
-------------------------------
Resolution: Duplicate
Closing as a duplicate of LOG4J2-3038.
> RollingFileAppender ignores TimeZone-Pattern
> --------------------------------------------
>
> Key: LOG4J2-3039
> URL: https://issues.apache.org/jira/browse/LOG4J2-3039
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.14.0
> Environment: Local time zone: GMT+1 (Berlin)
> Java-Version: 8
> Reporter: D. Kahlert
> Priority: Major
>
> At program start log4j calculates the correct time zone. For rolling up, it works with the local time and ignores the time zone pattern from the configuration.
> h2. Configuration
> <RollingFile name="RollingFile" filePattern="log-%d\{yyyy-MM-dd-HHZ}.log.gz">
> <PatternLayout>
> <Pattern>%d %-5p [%t] %C\{2} (%F:%L) - %m%n</Pattern>
> </PatternLayout>
> <Policies>
> <CronTriggeringPolicy schedule="0 0 * * * ?"/>
> </Policies>
> </RollingFile>
> h2. Result
> 2021-03-10 11:00:00,088 ... DEBUG Setting prev file time to 2021-03-10T10:00:00.000+0100
> 2021-03-10 11:00:00,088 ... DEBUG Rolling log-2021-03-10-10+0100.log
> 2021-03-10 11:00:00,088 ... DEBUG Formatting file name. useCurrentTime=false. currentFileTime=1615366800000, prevFileTime=1615366800000
> 2021-03-10 11:00:00,088 ... DEBUG Found 0 eligible files, max is 2147483647
> 2021-03-10 11:00:00,111 ... DEBUG OutputStream closed
> 2021-03-10 11:00:00,111 ... DEBUG RollingFileManager executing async GzCompressAction[log-2021-03-10-10+0100.log to log-2021-03-10-10+0100.log.gz, deleteSource=true]
> 2021-03-10 11:00:00,196 ... DEBUG Formatting file name. useCurrentTime=false. currentFileTime=1615366800000, prevFileTime=1615366800000
> 2021-03-10 11:00:00,196 ... DEBUG Formatting file name. useCurrentTime=true. currentFileTime=1615366800000, prevFileTime=1615366800000
> 2021-03-10 11:00:00,196 ... DEBUG Now writing to log-2021-03-10-10+0100.log at 2021-03-10T11:00:00.196+0100
> 2021-03-10 11:00:00,199 ... DEBUG Log4j2 ConfigurationScheduler Cron expression 0 0 * * * ? scheduled to fire again at 2021-03-10T12:00:00.000+0100
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)