aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2018-09-11 19:33:59 -0400
committerRafael Mendonça França <rafaelmfranca@gmail.com>2018-09-11 19:33:59 -0400
commite09c55dc8e958d2f68be262562e4083cc25b3756 (patch)
treea780ef3e5e2efec5f63b427ab95a7ccd9d594680 /activesupport/lib
parent9e2460393524556ac3aae7e84a0b077055ec1b4d (diff)
parent62fba74932a72ee8104712a3db432b593fe0c6af (diff)
downloadrails-e09c55dc8e958d2f68be262562e4083cc25b3756.tar.gz
rails-e09c55dc8e958d2f68be262562e4083cc25b3756.tar.bz2
rails-e09c55dc8e958d2f68be262562e4083cc25b3756.zip
Merge pull request #27792 from tjoyal/sandbox-tagged-logging
TaggedLogging to return a new logger instance
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/tagged_logging.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/tagged_logging.rb b/activesupport/lib/active_support/tagged_logging.rb
index b069ac94d4..dd72da500c 100644
--- a/activesupport/lib/active_support/tagged_logging.rb
+++ b/activesupport/lib/active_support/tagged_logging.rb
@@ -61,8 +61,15 @@ module ActiveSupport
end
def self.new(logger)
- # Ensure we set a default formatter so we aren't extending nil!
- logger.formatter ||= ActiveSupport::Logger::SimpleFormatter.new
+ logger = logger.dup
+
+ if logger.formatter
+ logger.formatter = logger.formatter.dup
+ else
+ # Ensure we set a default formatter so we aren't extending nil!
+ logger.formatter = ActiveSupport::Logger::SimpleFormatter.new
+ end
+
logger.formatter.extend Formatter
logger.extend(self)
end