Daily log rotation silently skipped on JRuby/Windows with logger 1.6.6 (File.identical?(lock, @dev) is false after fixup_mode)
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- ruby
调研方向
从 Logger.new("web-output.log", "daily") 和 logger 1.6.6 中的每日轮转路径开始,在 Windows 上的 JRuby 9.4.12.0 中复现问题。将 File.identical? 的行为和轮转流程与 logger 1.6.2 进行比较;完成的标准是,到期轮转会创建预期的带日期归档文件,而不是继续静默地写入同一个文件。
由索引模型根据 Issue 内容生成。
描述
Environment
- OS: Windows Server (service via Apache Commons Daemon / prunsrv)
- JRuby: 9.4.12.0 (OpenJDK 21)
- logger: 1.6.6 (broken) / 1.6.2 (works)
- Rails: 7.2, Puma single process (no workers)
Summary
After upgrading to logger 1.6.6, daily log rotation is silently skipped on JRuby/Windows.
Pinning logger to 1.6.2 restores rotation.
This is different from jruby/jruby#8801 (UnsatisfiedLinkError on flock).
We do not crash; rotation simply never happens.
Suspected cause
I observed that File.identical?(lock, dev) returns false
On our host, after fixup_mode, @dev fails the second identical? check:
(File.identical?(path, lock) rescue false)=true
(File.identical?(lock, dev) rescue false)=false
So lock_shift_log never yields -> shift_log_period never runs.
Reproduction(conceptual)
require "logger"
# With logger 1.6.6 on JRuby/Windows:
log = Logger.new("web-output.log", "daily")
# Force rotation due, then write:
# -> no archive created; same file continues
# With logger 1.6.2:
# -> archive created (e.g. web-output.log.YYYYMMDD)
- 主要语言
- Ruby
- 星标
- 161
- 派生
- 76
- 平均合并
- 2 天 5 小时
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ruby/logger 的其他 Issue
-
Programs using Logger sometimes resist SIGTERM / SIGINT可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 3/5 1-2 天 新手友好度 68/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
`datetime_format=` does not apply to custom formatters可能已有人在做 @Rubyist007 于 229 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 72/100
-
难度 4/5 3-5 天 新手友好度 35/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
open-feature/ruby-sdk-contrib#340 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
zold-io/wts.zold.io#651 ·
维护者通常 1 天内回复
-
good first issue help wanted
难度 2/5 1-3 小时 新手友好度 87/100
erkamyaman/rust-anything#788 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 74/100
TheOdinProject/curriculum#31579 ·
维护者通常 1 天内回复