Skip to content

Instantly share code, notes, and snippets.

@jamesarosen
Created August 20, 2009 22:29
Show Gist options
  • Save jamesarosen/171464 to your computer and use it in GitHub Desktop.
Save jamesarosen/171464 to your computer and use it in GitHub Desktop.
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
# ...
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