Created
October 25, 2009 07:08
-
-
Save akm/217941 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FormatterWithThread < Logger::Formatter | |
Format = "%s %s, [%s#%d] %5s -- %s: %s\n" | |
def call(severity, time, progname, msg) | |
Format % [(Thread.current[:name] || Thread.current.object_id).to_s, | |
severity[0..0], format_datetime(time), $$, severity, progname, | |
msg2str(msg)] | |
end | |
end | |
ActiveRecord::Base.logger = Logger.new(File.join(File.dirname(__FILE__), 'debug.log')) | |
ActiveRecord::Base.logger.formatter = FormatterWithThread.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment