Created
August 20, 2009 22:29
-
-
Save jamesarosen/171464 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
unless [:<<, :write, :flush].all? { |method| DEFAULT.respond_to?(method) } | |
RAILS_DEFAULT_LOGGER.instance_eval do | |
alias_method :<<, :info | |
alias_method :write, :info | |
def flush(*args, &block) | |
# do nothing | |
end | |
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
# ... | |
Rails::Initializer.run do |config| | |
# ... | |
# set up Syslog logging: | |
config.gem 'SyslogLogger', :version => '1.4.0' | |
require 'syslog_logger' | |
config.logger = RAILS_DEFAULT_LOGGER = SyslogLogger.new("my_rails_app.#{ENV['RAILS_ENV']}") | |
config.middleware.use Rack::CommonLogger, RAILS_DEFAULT_LOGGER | |
# ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment