Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Slogger is a Ruby library to help work with standard Ruby Syslog library

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 slogger.gemspec


Slogger is a Ruby library to help work with standard Ruby Syslog library.


Slogger is hosted on RubyGems (, so to install it is really easy.

$ gem install slogger



A more friendly wrapper on Ruby's Syslog.

Sample: simple message log

require "slogger"

# So in this sample:
# "sample_name": application name
# :info        : severity level
# :local0      : facility

slogger = "sample_app", :info, :local0 "A good info"
slogger.debug "A deep info (oops!)"  # it'll not be logged

slogger.severity = :debug
slogger.debug "A deep info (yay!)"   # now it'll be logged

# and after, look at the syslog file of your SO  ;)

Sample: message log preceded by spent time

require "slogger"

slogger = "sample_app", :debug, :local0 "A really good info preceded by spent time" do
  # do something

# and after, look at the syslog file of your SO  ;)


A useful class which exposes the Ruby's standard Syslog with the same API that Ruby's standard Logger to be used, for example, in Rails applications.

Just add the snippet below to the config/environments/developement.rb of an Rails application and everything will be logged thru the Ruby's standard Syslog library:

config.log_level = :info
config.logger = "rappils", config.log_level, :local0


A Rack middleware to log incoming requests.


require "slogger"

configure do
  slogger = "sample_app", :debug, :local0
  use Slogger::Rack::RequestLogger, slogger

# and after, look at the syslog file of your SO  ;)


I don't know. I think in adding more stuff sometime in the future. Let's see.

For now is it.

Quick view on Syslog RFC 5424

If you want to get a look at RFC 5424, which I really recommend, you can go to:

According to that:

# Message Severities
# - Emergency: system is unusable
# - Alert: action must be taken immediately
# - Critical: critical conditions
# - Error: error conditions
# - Warning: warning conditions
# - Notice: normal but significant condition
# - Informational: informational messages
# - Debug: debug-level messages


# Message Facilities
# - kernel messages
# - user-level messages
# - mail system
# - system daemons
# - security/authorization messages
# - messages generated internally by syslogd
# - line printer subsystem
# - network news subsystem
# - UUCP subsystem
# - clock daemon
# - security/authorization messages
# - FTP daemon
# - NTP subsystem
# - log audit
# - log alert
# - clock daemon (note 2)
# - local use 0  (local0)
# - local use 1  (local1)
# - local use 2  (local2)
# - local use 3  (local3)
# - local use 4  (local4)
# - local use 5  (local5)
# - local use 6  (local6)
# - local use 7  (local7)


Copyright © 2011 Leandro Silva (CodeZone).

Something went wrong with that request. Please try again.