log4shib 2.0.0

Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
log4shib::SyslogAppender Class Reference

SyslogAppender sends LoggingEvents to the local syslog system. More...

`#include <SyslogAppender.hh>`

Inheritance diagram for log4shib::SyslogAppender:
[legend]
Collaboration diagram for log4shib::SyslogAppender:
[legend]

## Public Member Functions
| SyslogAppender (const std::string &name, const std::string &syslogName, int facility=LOG_USER)
| Instantiate a SyslogAppender with given name and name and facility for syslog. More...
virtual | ~SyslogAppender ()
virtual bool | reopen ()
| Calls closelog(3) and openlog(3). More...
virtual void | close ()
| Calls closelog(3) to close the syslog file descriptor. More...
Public Member Functions inherited from log4shib::LayoutAppender
| LayoutAppender (const std::string &name)
virtual | ~LayoutAppender ()
virtual bool | requiresLayout () const
| Check if the appender requires a layout. More...
virtual void | setLayout (Layout *layout=NULL)
| Set the Layout for this appender. More...
Public Member Functions inherited from log4shib::AppenderSkeleton
virtual | ~AppenderSkeleton ()
| Destructor for AppenderSkeleton. More...
virtual void | doAppend (const LoggingEvent &event)
| Log in Appender specific way. More...
virtual bool | reopen ()
| Reopens the output destination of this Appender, e.g. More...
virtual void | close ()=0
| Release any resources allocated within the appender such as file handles, network connections, etc. More...
virtual bool | requiresLayout () const =0
| Check if the appender uses a layout. More...
virtual void | setLayout (Layout *layout)=0
| Set the Layout for this appender. More...
virtual void | setThreshold (Priority::Value priority)
| Set the threshold priority of this Appender. More...
virtual Priority::Value | getThreshold ()
| Get the threshold priority of this Appender. More...
virtual void | setFilter (Filter *filter)
| Set a Filter for this appender. More...
virtual Filter * | getFilter ()
| Get the Filter for this appender. More...
Public Member Functions inherited from log4shib::Appender
virtual | ~Appender ()
| Destructor for Appender. More...
virtual void | doAppend (const LoggingEvent &event)=0
| Log in Appender specific way. More...
virtual bool | reopen ()=0
| Reopens the output destination of this Appender, e.g. More...
virtual void | close ()=0
| Release any resources allocated within the appender such as file handles, network connections, etc. More...
virtual bool | requiresLayout () const =0
| Check if the appender uses a layout. More...
virtual void | setLayout (Layout *layout)=0
| Set the Layout for this appender. More...
const std::string & | getName () const
| Get the name of this appender. More...
virtual void | setThreshold (Priority::Value priority)=0
| Set the threshold priority of this Appender. More...
virtual Priority::Value | getThreshold ()=0
| Get the threshold priority of this Appender. More...
virtual void | setFilter (Filter *filter)=0
| Set a Filter for this appender. More...
virtual Filter * | getFilter ()=0
| Get the Filter for this appender. More...

## Static Public Member Functions
static int | toSyslogPriority (Priority::Value priority)
| Translates a log4shib priority to a syslog priority. More...
Static Public Member Functions inherited from log4shib::Appender
static Appender * | getAppender (const std::string &name)
| Get a pointer to an exitsing Appender. More...
static bool | reopenAll ()
| Call reopen() on all existing Appenders. More...
static void | closeAll ()
| Call reopen() on all existing Appenders. More...

## Protected Member Functions
virtual void | open ()
| Calls openlog(3). More...
virtual void | _append (const LoggingEvent &event)
| Sends a LoggingEvent to syslog. More...
Protected Member Functions inherited from log4shib::LayoutAppender
Layout & | _getLayout ()
| Return the layout of the appender. More...
Protected Member Functions inherited from log4shib::AppenderSkeleton
| AppenderSkeleton (const std::string &name)
| Constructor for AppenderSkeleton. More...
virtual void | _append (const LoggingEvent &event)=0
| Log in Appender specific way. More...
Protected Member Functions inherited from log4shib::Appender
| Appender (const std::string &name)
| Constructor for Appender. More...

## Protected Attributes
const std::string | _syslogName
int | _facility

## Additional Inherited Members
Public Types inherited from log4shib::LayoutAppender
typedef BasicLayout | DefaultLayoutType

## Detailed Description

SyslogAppender sends LoggingEvents to the local syslog system.

## Constructor & Destructor Documentation

## ◆ SyslogAppender()

log4shib::SyslogAppender::SyslogAppender | ( | const std::string & | name,
|  | const std::string & | syslogName,
|  | int | facility = `LOG_USER`
| ) |  |

Instantiate a SyslogAppender with given name and name and facility for syslog.

Note that the C syslog API is process global, so instantion of a second SyslogAppender will 'overwrite' the syslog name of the first.

Parameters

  name | The name of the Appender
  syslogName | The ident parameter in the openlog(3) call.
  facility | The syslog facility to log to. Defaults to LOG_USER.

## ◆ ~SyslogAppender()

virtual log4shib::SyslogAppender::~SyslogAppender | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ _append()

virtual void log4shib::SyslogAppender::_append | ( | const LoggingEvent & | event | ) |
| protected virtual

Sends a LoggingEvent to syslog.

Parameters

  event | the LoggingEvent to log.

Implements log4shib::AppenderSkeleton.

## ◆ close()

virtual void log4shib::SyslogAppender::close | ( |  | ) |
| virtual

Calls closelog(3) to close the syslog file descriptor.

Implements log4shib::AppenderSkeleton.

## ◆ open()

virtual void log4shib::SyslogAppender::open | ( |  | ) |
| protected virtual

Calls openlog(3).

## ◆ reopen()

virtual bool log4shib::SyslogAppender::reopen | ( |  | ) |
| virtual

Calls closelog(3) and openlog(3).

Reimplemented from log4shib::AppenderSkeleton.

## ◆ toSyslogPriority()

static int log4shib::SyslogAppender::toSyslogPriority | ( | Priority::Value | priority | ) |
| static

Translates a log4shib priority to a syslog priority.

Parameters

  priority | The log4shib priority.

Returns
  the syslog priority.

## Member Data Documentation

## ◆ _facility

int log4shib::SyslogAppender::_facility
| protected

## ◆ _syslogName

const std::string log4shib::SyslogAppender::_syslogName
| protected

The documentation for this class was generated from the following file:

- SyslogAppender.hh