lib/semantic_logger/logger.rb in semantic_logger-0.11.2 vs lib/semantic_logger/logger.rb in semantic_logger-0.11.3
- old
+ new
@@ -211,11 +211,16 @@
end
rescue Exception => exception
logger.error "Appender thread restarting due to exception", exception
retry
ensure
- logger.debug "Appender thread has stopped"
@@appender_thread = nil
+ # This block may be called after the file handles have been released by Ruby
+ begin
+ logger.debug "Appender thread has stopped"
+ rescue Exception
+ nil
+ end
end
end
# Flush all appenders at exit, waiting for outstanding messages on the queue
# to be written first