Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

An updated version of log4r with a few bug fixes and enhancements (my fork includes an new syslog outputter)

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

This forks adds the SeattleRbSyslogOutputter outputter. It uses the SyslogLogger gem from Seattle.rb, which is a wrapper around the Syslog standard Ruby class.
This outputter, unlike SyslogOutputter provided by Log4r, does not set application-wide custom levels, so it does not break other loggers and outputters.

To load it, add this to your Yaml configuration file:

- type        : SeattleRbSyslogOutputter
  name        : syslog
  level       : DEBUG
  application : my_application_configured_in_syslog_conf
  # Syslog adds the pid and the date itself
    pattern     : '<%C> %l: %m'
    type        : PatternFormatter


Original manual provided here:

== Enhancements

We have added support for an Nested Diagnostic Context, or NDC and GDC.
=== NDC

NDCs are per thread, and can be set by:


Then in the configuration xml it can be used:


Which will output the top most diagnostic message on the NDC stack.

Based on the log4j NDC implementation:

=== GDC

We also added a Global Diagnostic Context for per application diagnostic messages.

Log4r::Logger.GDC = "app1"

Then in the configuration xml it can be used:


log4_logging.rb uses this to set the message to be the name of the rails application.  
This can be useful for sorting messages if logs for multiple applications are aggregated at a single point, 
for example in something like Splunk.

Something went wrong with that request. Please try again.