SyslogAppender Class Reference

Inheritance diagram for SyslogAppender:

AppenderSkeleton Appender ObjectImpl OptionHandler Object Object List of all members.

Public Member Functions

void close ()
void append (const spi::LoggingEventPtr &event)
void activateOptions ()
void setOption (const String &option, const String &value)
virtual bool requiresLayout () const
void setSyslogHost (const String &syslogHost)
const String & getSyslogHost () const
void setFacility (const String &facilityName)
String getFacility () const
void setFacilityPrinting (bool facilityPrinting)
bool getFacilityPrinting () const

Static Public Member Functions

static String getFacilityString (int syslogFacility)
static int getFacility (const String &facilityName)

Detailed Description

Use SyslogAppender to send log messages to a remote syslog daemon.


Member Function Documentation

void activateOptions (  )  [virtual]

This method returns immediately as options are activated when they are set.

Reimplemented from AppenderSkeleton.

void append ( const spi::LoggingEventPtr event  )  [virtual]

Subclasses of AppenderSkeleton should implement this method to perform actual logging. See also AppenderSkeleton::doAppend method.

Implements AppenderSkeleton.

void close (  )  [virtual]

Release any resources held by this SyslogAppender.

Implements Appender.

String getFacility (  )  const [inline]

Returns the value of the Facility option.

int getFacility ( const String &  facilityName  )  [static]

Returns the integer value corresponding to the named syslog facility, or -1 if it couldn't be recognized.

Parameters:
facilityName one of the strings KERN, USER, MAIL, DAEMON, AUTH, SYSLOG, LPR, NEWS, UUCP, CRON, AUTHPRIV, FTP, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. The matching is case-insensitive.

bool getFacilityPrinting (  )  const [inline]

Returns the value of the FacilityPrinting option.

String getFacilityString ( int  syslogFacility  )  [static]

Returns the specified syslog facility as a lower-case String, e.g. "kern", "user", etc.

const String& getSyslogHost (  )  const [inline]

Returns the value of the SyslogHost option.

virtual bool requiresLayout (  )  const [inline, virtual]

The SyslogAppender requires a layout. Hence, this method returns true.

Implements Appender.

void setFacility ( const String &  facilityName  ) 

Set the syslog facility. This is the Facility option.

The facilityName parameter must be one of the strings KERN, USER, MAIL, DAEMON, AUTH, SYSLOG, LPR, NEWS, UUCP, CRON, AUTHPRIV, FTP, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. Case is unimportant.

void setFacilityPrinting ( bool  facilityPrinting  )  [inline]

If the FacilityPrinting option is set to true, the printed message will include the facility name of the application. It is false by default.

void setOption ( const String &  option,
const String &  value 
) [virtual]

Set option to value.

The handling of each option depends on the OptionHandler instance. Some options may become active immediately whereas other may be activated only when activateOptions is called.

Reimplemented from AppenderSkeleton.

void setSyslogHost ( const String &  syslogHost  ) 

The SyslogHost option is the name of the the syslog host where log output should go. WARNING If the SyslogHost is not set, then this appender will fail.


The documentation for this class was generated from the following files:
Generated on Sat Feb 9 16:52:11 2008 for log4cxx by  doxygen 1.4.7