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 天內回覆