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

#include <SyslogAppender.hh>

Inheritance diagram for log4cpp::SyslogAppender:
Inheritance graph
[legend]

Public Member Functions

virtual void close ()
 
virtual bool reopen ()
 
 SyslogAppender (const std::string &name, const std::string &syslogName, int facility=LOG_USER)
 
virtual ~SyslogAppender ()
 
- Public Member Functions inherited from log4cpp::LayoutAppender
 LayoutAppender (const std::string &name)
 
virtual bool requiresLayout () const
 
virtual void setLayout (Layout *layout=NULL)
 
virtual ~LayoutAppender ()
 
- Public Member Functions inherited from log4cpp::AppenderSkeleton
virtual void doAppend (const LoggingEvent &event)
 
virtual FiltergetFilter ()
 
virtual Priority::Value getThreshold ()
 
virtual void setFilter (Filter *filter)
 
virtual void setThreshold (Priority::Value priority)
 
virtual ~AppenderSkeleton ()
 
- Public Member Functions inherited from log4cpp::Appender
const std::string & getName () const
 
virtual ~Appender ()
 

Static Public Member Functions

static int toSyslogPriority (Priority::Value priority)
 
- Static Public Member Functions inherited from log4cpp::Appender
static void closeAll ()
 
static AppendergetAppender (const std::string &name)
 
static bool reopenAll ()
 

Protected Member Functions

virtual void _append (const LoggingEvent &event)
 
virtual void open ()
 
- Protected Member Functions inherited from log4cpp::LayoutAppender
Layout_getLayout ()
 
- Protected Member Functions inherited from log4cpp::AppenderSkeleton
 AppenderSkeleton (const std::string &name)
 
- Protected Member Functions inherited from log4cpp::Appender
 Appender (const std::string &name)
 

Protected Attributes

int _facility
 
const std::string _syslogName
 

Additional Inherited Members

- Public Types inherited from log4cpp::LayoutAppender
typedef BasicLayout DefaultLayoutType
 

Detailed Description

SyslogAppender sends LoggingEvents to the local syslog system.

Definition at line 25 of file SyslogAppender.hh.

Constructor & Destructor Documentation

log4cpp::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
nameThe name of the Appender
syslogNameThe ident parameter in the openlog(3) call.
facilityThe syslog facility to log to. Defaults to LOG_USER.
virtual log4cpp::SyslogAppender::~SyslogAppender ( )
virtual

Member Function Documentation

virtual void log4cpp::SyslogAppender::_append ( const LoggingEvent event)
protectedvirtual

Sends a LoggingEvent to syslog.

Parameters
eventthe LoggingEvent to log.

Implements log4cpp::AppenderSkeleton.

virtual void log4cpp::SyslogAppender::close ( )
virtual

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

Implements log4cpp::AppenderSkeleton.

virtual void log4cpp::SyslogAppender::open ( )
protectedvirtual

Calls openlog(3).

virtual bool log4cpp::SyslogAppender::reopen ( )
virtual

Calls closelog(3) and openlog(3).

Reimplemented from log4cpp::AppenderSkeleton.

static int log4cpp::SyslogAppender::toSyslogPriority ( Priority::Value  priority)
static

Translates a log4cpp priority to a syslog priority

Parameters
priorityThe log4cpp priority.
Returns
the syslog priority.

Member Data Documentation

int log4cpp::SyslogAppender::_facility
protected

Definition at line 72 of file SyslogAppender.hh.

const std::string log4cpp::SyslogAppender::_syslogName
protected

Definition at line 71 of file SyslogAppender.hh.


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


log4cpp
Author(s): Stephen Roderick, Bastiaan Bakker, Cedric Le Goater, Steve Ostlind, Marcel Harkema, Walter Stroebel, Glenn Scott and Tony Cheung
autogenerated on Sun Jun 23 2019 19:14:17