|
A SyslogOutputter transforms a Log4r::LogEvent into a call to syslog(). Since syslog has its own formatting system, log4r formatters are ignored.
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 |
Classes and Modules |