Bug #12468

Logger: Can not rotate (log shifting failed. closed stream)

Added by rovf (Ronald Fischer) over 4 years ago. Updated about 1 month ago.

Target version:
ruby -v:
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-cygwin]


If I configure a Logger to rotate, by the time the logger is supposed to do the first rotation, it creates the new log file, but then hangs. When I abort the program using Control-C, I get an infinite series of error messages saying

log shifting failed. closed stream

You can reproduce the error, if you run the attached example program on Windows (it could be a platform issue). The only prerequisite is that a subdirectory 'logs' must exist below the working directory.

I'm reporting error for the Cygwin version of Ruby. However, I found the nearly identical error also with JRuby 1.9.3, which suggests that the bug is likely in the Ruby stdlib code, and not in the specific port (i.e. Cygwin vs. JRuby). The main difference between the behaviour of the bug in Cygwin Ruby vs. JRuby is that aborting the program on JRuby does not produced the "log shifting...." error message.


logtest_s.rb (481 Bytes) logtest_s.rb Example program to demonstrate the error rovf (Ronald Fischer), 06/07/2016 12:06 PM

Updated by rovf (Ronald Fischer) over 4 years ago

Update: Please disregard my comments related to the bug occuring on JRuby. It seems that I made a mistake when trying to reproduce it there.

For the time being, I can only say that it occurs on Cygwin Ruby 2.2.4

Updated by jeremyevans0 (Jeremy Evans) about 1 month ago

I can't test cygwin, but I've added a pull request to logger that should fix this by treating cygwin like mswin and mingw in regards to log shifting:


Updated by jeremyevans0 (Jeremy Evans) about 1 month ago

  • Status changed from Open to Closed

Also available in: Atom PDF