Logging to a central server is done through syslog. We are using papertrail to host our logs.
heroku drains:add syslog://SUBDOMAIN.papertrailapp.com:PORT
Add remote_syslog_logger
to :production, :staging
group in Gemfile
group :production, :staging do
gem 'remote_syslog_logger'
end
Add logger and log level to config/environments/production.rb
and config/environments/staging.rb
config.logger = RemoteSyslogLogger.new('SUBDOMAIN.papertrailapp.com', PORT, program: "rails-#{Rails.application.class.name.split('::').first}")
config.logger.level = Logger::Severity::INFO
As root
edit /etc/rsyslog.conf
Add the following line:
*.* @SUBDOMAIN.papertrailapp.com:PORT
once you have added that restart the syslog process
service rsyslog restart
Log into https://papertrailapp.com Select system Optionally “Create Group” and select a system filter (or systems individually)