Browse files

make the tagged formatter extend the existing formatter

  • Loading branch information...
1 parent 0f5b32c commit 7f40b9cd429cabad80ef9d8fbe3a169d14bf1dba @tenderlove tenderlove committed Mar 12, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 activesupport/lib/active_support/tagged_logging.rb
View
4 activesupport/lib/active_support/tagged_logging.rb
@@ -13,7 +13,7 @@ module ActiveSupport
# This is used by the default Rails.logger as configured by Railties to make it easy to stamp log lines
# with subdomains, request ids, and anything else to aid debugging of multi-user production applications.
module TaggedLogging
- class Formatter < ActiveSupport::Logger::SimpleFormatter # :nodoc:
+ module Formatter # :nodoc:
# This method is invoked when a log event occurs
def call(severity, timestamp, progname, msg)
super(severity, timestamp, progname, "#{tags_text}#{msg}")
@@ -37,7 +37,7 @@ def tags_text
end
def self.new(logger)
- logger.formatter = Formatter.new
+ logger.formatter.extend Formatter
logger.extend(self)
end

0 comments on commit 7f40b9c

Please sign in to comment.