Class Log4r::SyslogOutputter
In: lib/log4r/outputter/syslogoutputter.rb
Parent: Outputter

Methods

Included Modules

Syslog::Constants

Constants

SYSLOG_LEVELS_MAP = { "DEBUG" => LOG_DEBUG, "INFO" => LOG_INFO, "NOTICE" => LOG_NOTICE, # by default NOTICE is not in log4r "WARN" => LOG_WARNING, "ERROR" => LOG_ERR, "FATAL" => LOG_CRIT, "ALERT" => LOG_ALERT, # by default ALERT is not in log4r "EMERG" => LOG_EMERG, # by default EMERG is not in log4r }   maps default log4r levels to syslog priorities (logevents never see ALL and OFF) SYSLOG Levels are:
 "DEBUG"  => Syslog::LOG_DEBUG
 "INFO"   => Syslog::LOG_INFO
 "NOTICE" => Syslog::LOG_NOTICE
 "WARN"   => Syslog::LOG_WARN
 "ERROR"  => Syslog::LOG_ERROR
 "FATAL"  => Syslog::LOG_FATAL
 "ALERT"  => Syslog::LOG_ALERT
 "EMERG"  => Syslog::LOG_EMERG
SYSLOG_LOG4R_MAP = { "DEBUG" => "DEBUG", "INFO" => "INFO", "WARN" => "WARN", "ERROR" => "ERROR", "FATAL" => "FATAL"   mapping from Log4r default levels to syslog, by string name "DEBUG" => "DEBUG"
 "INFO"   => "INFO"
 "WARN"   => "WARN"
 "ERROR"  => "ERROR"
 "FATAL"  => "FATAL"

Public Class methods

There are 3 hash arguments

:ident
syslog ident, defaults to _name
:logopt
syslog logopt, defaults to LOG_PID | LOG_CONS
:facility
syslog facility, defaults to LOG_USER

Public Instance methods

A single hash argument that maps custom names to syslog names

levels_map
A map that will create a linkage between levels in a hash and underlying syslog levels. By default, these are direct mapping of the log4r levels (e.g. "DEBUG" => "DEBUG") If you have defined your own custom levels, you should provide this underlying mapping, otherwise all messages will be mapped to the underlying syslog level of INFO by default. e.g. You have created custom levels called: Configurator.custom_levels "HIGH", "MEDIUM", "LOW" To map these to ‘equivilent’ syslog levels, after instantiatin a syslogoutputter: SyslogOutputter.map_levels_by_name_to_syslog( { "HIGH" => "ALERT", "MEDIUM" => "WARN", "LOW" => "INFO" } )

[Validate]