Here is the production steps (basically I copied what was logged in Logger gem repository ruby/logger#67)
1) Test script:
test_logger.rb
logger = Logger.new("D:/log.txt", 5, 1024)
150.times do |i|
logger.info i
end
2) run script:
The easiest way to run JRuby in windows would be installing Java 11 and downloading jruby-complete-9.3.0.0.jar, then run:
D:\>java -jar jruby-complete-9.3.0.0.jar test_logger.rb
3) Console output:
log rotation inter-process lock failed. D:\log.txt -> D:\log.txt.0: The process cannot access the file because it is being used by another process.
log writing failed. closed stream
log shifting failed. closed stream
log writing failed. closed stream
log shifting failed. closed stream
...
4) Cause:
The issue occurs due JRuby returns java for RUBY_PLATFORM when loading the method lock_shift_log