File: syslogoutputter.rb [log4r-1.1.10 Documentation]

Last Modified
  2014-02-16 05:36:15 +0000
Requires
  - log4r/formatter/formatter
  - log4r/outputter/outputter
  - log4r/configurator
  - syslog

## Description

# SyslogOutputter

A SyslogOutputter transforms a Log4r::LogEvent into a call to syslog(). Since syslog has its own formatting system, log4r formatters are ignored.

## Usage

To use,

    <tt>require 'log4r/outputter/syslogoutputter'</tt>

An example,

    require 'log4r'
    require 'log4r/outputter/syslogoutputter'

    syslog = Log4r::SyslogOutputter.new("name", 'logopt'=>#, 'facility'=>#)
    syslog.err("this is an ERR message")

The output in `/var/logs/syslog` (Debian) is,

    Sep  3 11:43:06 tiphares sys[1603]: this is an ERR message

The hash arguments `logoptions` and `facility` are passed to `Syslog.open`. The defaults are `LOG_PID | LOG_CONS` and `LOG_USER` respectively.

This is a first try implementation. It works well. Please report any bugs and fixes.

Version | $Id$
Author | Steve Lumos
Author | Leon Torres