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:
parent
32f010da68
commit
f0dafa632a
2 changed files with 7 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
HEAD
|
||||
-----------
|
||||
|
||||
- log rotation via USR2 didn't close the old logger [#1008]
|
||||
|
||||
2.12.4
|
||||
-----------
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue