File
syslogoutputter.rb
Path: log4r/outputter/syslogoutputter.rb
Modified: Wed Mar 17 12:18:00 PST 2004

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.5 2004/03/17 20:18:00 fando Exp $
Author:Steve Lumos
Author:Leon Torres
Required files

log4r/formatter/formatter log4r/outputter/outputter log4r/configurator syslog
Classes and Modules

Module Log4r
  ::Class Log4r::BasicFormatter
  ::Class Log4r::ConfigError
  ::Class Log4r::Configurator
  ::Class Log4r::DateFileOutputter
  ::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
  ::Class Log4r::YamlConfigurator