Skip to content

Daily log rotation silently skipped on JRuby/Windows with logger 1.6.6 (File.identical?(lock, @dev) is false after fixup_mode) #165

Description

@tkaabbc

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions