| Path: | lib/log4r/outputter/syslogoutputter.rb |
| Last Update: | Tue Mar 24 08:26:00 +0000 2015 |
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$ |
| Author: | Steve Lumos |
| Author: | Leon Torres |