Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
papertrail setttings for rails4 application
# config/environments/production.rb
# Be sure to add remote_syslog_logger to Gemfile
config.after_initialize do
if ENV["SYSLOG_URL"]
require "remote_syslog_logger"
require "uri"
url = URI.parse(ENV["SYSLOG_URL"])
logger = RemoteSyslogLogger.new(url.host, url.port, program: "#{url.path[1..-1]}-#{Rails.env}")
logger.level = Logger::INFO
Rails.logger = config.logger = ActionController::Base.logger = Rails.cache.logger = logger
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.