Created
October 20, 2010 14:56
-
-
Save eric1234/636575 to your computer and use it in GitHub Desktop.
Logger that writes to logworm
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 LogwormLogger < ActiveSupport::BufferedLogger | |
def initialize(level = DEBUG) | |
super Logworm::Logger, level | |
end | |
end | |
class Logworm::Logger | |
def self.write(msg) | |
table = defined?(Rails) ? "#{Rails.env}_logger" : 'logger' | |
log table, :msg => msg | |
end | |
end |
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
config.logger = LogwormLogger.new config.log_level |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A first stab at using Logworm to log the Rails logger messages. Completely untested at this point. Just an experiment.