1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Close old logger when rotating, fixes #1008

This commit is contained in:
Mike Perham 2013-06-18 13:44:19 -07:00
parent 32f010da68
commit f0dafa632a
2 changed files with 7 additions and 0 deletions

View file

@ -1,3 +1,8 @@
HEAD
-----------
- log rotation via USR2 didn't close the old logger [#1008]
2.12.4
-----------

View file

@ -26,9 +26,11 @@ module Sidekiq
end
def self.initialize_logger(log_target = STDOUT)
oldlogger = @logger
@logger = Logger.new(log_target)
@logger.level = Logger::INFO
@logger.formatter = Pretty.new
oldlogger.close if oldlogger && !$TESTING # don't want to close testing's STDOUT logging
@logger
end