File: syslogoutputter.rb

File syslogoutputter.rb |
Path: | log4r/outputter/syslogoutputter.rb
Modified: | Tue Sep 02 20:50:24 PDT 2003

# 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: syslogoutputter.rb,v 1.4 2003/09/03 03:50:24 cepheus Exp $
Author: | Steve Lumos
Author: | Leon Torres

Required files

log4r/formatter/formatter log4r/formatter/formatter log4r/formatter/formatter log4r/formatter/formatter

Classes and Modules

Module Log4r
::Class Log4r::BasicFormatter
::Class Log4r::ConfigError
::Class Log4r::Configurator
::Class Log4r::DefaultFormatter
::Class Log4r::EmailOutputter
::Class Log4r::FileOutputter
::Class Log4r::Formatter
::Class Log4r::IOOutputter
::Class Log4r::Log4rTools
::Class Log4r::LogEvent
::Class Log4r::LogServer
::Class Log4r::Logger
::Class Log4r::ObjectFormatter
::Class Log4r::Outputter
::Class Log4r::PatternFormatter
::Class Log4r::RemoteOutputter
::Class Log4r::RollingFileOutputter
::Class Log4r::RootLogger
::Class Log4r::SimpleFormatter
::Class Log4r::StderrOutputter
::Class Log4r::StdoutOutputter
::Class Log4r::SyslogOutputter