[
https://issues.apache.org/jira/browse/LOG4J2-3653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17715566#comment-17715566
]
Piotr Karwasz commented on LOG4J2-3653:
---------------------------------------
[~baborin],
Sorry for the delay, we mainly use [Github
issues|https://github.com/apache/logging-log4j2/issues] now and don't check
JIRA too often.
What is the default time zone of your server? The {{CronTriggeringPolicy}} uses
the timezone of the server to schedule events. So if the default timezone of
your JVM is {{UTC}}, the triggering policy will also use {{UTC}}. The timezone
parameter in your file pattern is used only for the file name.
We might consider adding a {{timezone}} parameter to {{CronTriggeringPolicy}}
in a future release.
> RollingFile TimeZone still doesn't work
> ---------------------------------------
>
> Key: LOG4J2-3653
> URL: https://issues.apache.org/jira/browse/LOG4J2-3653
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.20.0
> Environment: Java 17
> Spring Boot 2.7.9
> Log4j2 2.20
> Reporter: NamHyoekJoon
> Priority: Major
>
> It has been reported that the RollingFile TimeZone issue has been fixed in
> version 2.20.
> But it still follows the server time and the TimeZone I specified is ignored.
> {code:java}
> <RollingFile name="DefaultAppender"
> fileName="${sys:LOG_PATH}/${sys:DEFAULT_LOG_NAME}"
> filePattern="./log/backup/default/app2-%d{yyyy-MM-dd}{GMT+9}.log.gz">
> <PatternLayout pattern="${sys:FILE_LOG_PATTERN}"/>
> <Policies>
> <CronTriggeringPolicy schedule="0 0 17 * * ? *" />
> <SizeBasedTriggeringPolicy size="10 MB" />
> </Policies>
> </RollingFile>
> {code}
> Action I wanted: Action at 08:00:00 UTC.
> Actual operation: Operates at 17:00:00 UTC.
> The time I specify should be the same as my locale's time reflected by the
> TimeZone.
> But still my TimeZone in terms of UTC is meaningless.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)