-
Notifications
You must be signed in to change notification settings - Fork 2
Centralized Logging
Ben Wyrosdick edited this page Mar 14, 2015
·
5 revisions
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 group in Gemfile
Add logger and log level to production.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
Checking log Log into https://papertrailapp.com Select system Optionally “Create Group” and select a system filter (or systems individually)