Steps to get Rails 4 saving its output to Syslog via Rsyslog. This assumes you are on CentOS
, but should be pretty adaptable to any other distribution. Ruby 2.0+
is also required.
- Add the gems
lograge
andlogstash-event
to yourGemfile
. Feel free to remove fromproduction
if you'd like to test it indevelopment
as well or something. - Update
production.rb
with thelograge
settings and set thelogger
toSyslog::Logger
. - Add the
conf
files to/etc/rsyslog.d/
./etc/rsyslog.conf
should have$IncludeConfig /etc/rsyslog.d/*.conf
enabled, so it will load any additional configs from/etc/rsyslog.conf
.