diff options
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/buffered_logger.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/buffered_logger.rb b/activesupport/lib/active_support/buffered_logger.rb index b2c863c893..445d8edf47 100644 --- a/activesupport/lib/active_support/buffered_logger.rb +++ b/activesupport/lib/active_support/buffered_logger.rb @@ -96,9 +96,12 @@ module ActiveSupport @guard.synchronize do unless buffer.empty? old_buffer = buffer - clear_buffer @log.write(old_buffer.join) end + + # Important to do this even if buffer was empty or else @buffer will + # accumulate empty arrays for each request where nothing was logged. + clear_buffer end end |