Logfile not rotating when falling back on DST

未关闭
#3,980 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@ppkarwasz 已经在做这个了。

开始于 2026年1月16日。

评估

这个 Issue 还没有评估数据。

描述

appenders:Rolling bug priority: P2

Description

		<RollingFile name="MANAGEMENT_FILE" fileName="/logs/management-kernel.log"
					filePattern="/logs/management-kernel.log.%d{yyyy-MM-dd-HH}">
			<Policies>
				<CronTriggeringPolicy schedule="0 0 * * * ?" />
			</Policies>
			<PatternLayout>
				<!-- The default pattern: Date Priority [Category] Message\n -->
				<Pattern>%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%t] [%c{1}] %m%n</Pattern>
				<Charset>UTF-8</Charset>
			</PatternLayout>
		</RollingFile>

Based on the CronTriggeringPolicy above, logs should roll ever hour, and it normally works perfectly, as intended. However on the DST fallback night (11/1) the log didn't roll on the 1am hour the first time. That means that by the time the clock was 2 am, the log had the contents of the 00 and 01 hour. And then at 2 am DST happened, the log DID roll this time, and a new file was generated for the "second run" of the 1am hour. Then everything worked properly, as it always does.

Is this "not rolling" 1 hour before DST is reached done on purpose?

Configuration

Version: log4j-core-2.22.0.jar

Operating system: RHEL 8.1

JDK: jdk-17.0.9+9-jre

主要语言
Java
星标
3.6k
派生
1.8k
平均合并
5 天 6 小时
30 天内合并 PR
24

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/logging-log4j2 的其他 Issue

查看 apache/logging-log4j2 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。