This library providers an ActiveSupport compatible logger that logs directly to a remote syslogd via UDP.
The easiest way to install remote_syslog_logger
is with Bundler. Add
remote_syslog_logger
to your Gemfile
.
If you are not using a Gemfile
, run:
$ [sudo] gem install remote_syslog_logger
Use from Rails:
config.logger = RemoteSyslogLogger.new('syslog.domain.com', 514, :program => "rails-#{RAILS_ENV}")
Use from Ruby:
$logger = RemoteSyslogLogger.new('syslog.domain.com', 514)
To point the logs to your local system, use localhost
and ensure that
the system's syslog daemon is bound to 127.0.0.1
.
Remote Syslog Logger is available on GitHub, which can be browsed at:
http://github.com/papertrail/remote_syslog_logger
and cloned with:
$ git clone git://github.com/papertrail/remote_syslog_logger.git
If the specified host cannot be resolved, syslog.domain.com
in the
example under the usage section above, remote_syslog_logger
will block
for approximately 20 seconds before displaying an error. This could
result in the application failing to start or even stopping responding.
Workarounds for this include:
- use an IP address instead of a hostname.
- put a hosts entry in
/etc/hosts
or equivalent, so that DNS is not actually consulted - instead of logging directly to the network, write to a file and transmit new entries with a standalone daemon like remote_syslog,
Once you've made your great commits:
- Fork
remote_syslog_logger
- Create a topic branch -
git checkout -b my_branch
- Push to your branch -
git push origin my_branch
- Create a Pull Request or an Issue with a link to your branch
- That's it!
You might want to checkout Resque's Contributing wiki page for information on coding standards, new features, etc.
Copyright (c) 2011-2014 Eric Lindvall. See LICENSE for details.