Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

log4cpp::SyslogAppender Class Reference

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

#include <SyslogAppender.hh>

Inheritance diagram for log4cpp::SyslogAppender:

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

Collaboration graph
[legend]
List of all members.

Public Methods

 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).

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

virtual bool requiresLayout () const
 The SyslogAppender requires a Layout. More...

virtual void setLayout (Layout *layout)
 Set the Layout for this appender. More...


Static Public Methods

int toSyslogPriority (Priority::Value priority)
 Translates a log4cpp priority to a syslog priority. More...


Protected Methods

virtual void open ()
 Calls openlog(3).

virtual void _append (const LoggingEvent &event)
 Sends a LoggingEvent to syslog. More...


Protected Attributes

const std::string _syslogName
int _facility
Layout_layout

Detailed Description

SyslogAppender sends LoggingEvents to the local syslog system.


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:
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.

virtual log4cpp::SyslogAppender::~SyslogAppender ( ) [virtual]
 


Member Function Documentation

void log4cpp::SyslogAppender::_append ( const LoggingEvent & event ) [protected, virtual]
 

Sends a LoggingEvent to syslog.

Parameters:
event   the LoggingEvent to log.

Reimplemented from log4cpp::AppenderSkeleton.

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

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

Reimplemented from log4cpp::AppenderSkeleton.

void log4cpp::SyslogAppender::open ( ) [protected, virtual]
 

Calls openlog(3).

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

Calls closelog(3) and openlog(3).

Reimplemented from log4cpp::AppenderSkeleton.

bool log4cpp::SyslogAppender::requiresLayout ( ) const [virtual]
 

The SyslogAppender requires a Layout.

Returns:
true

Reimplemented from log4cpp::AppenderSkeleton.

virtual void log4cpp::SyslogAppender::setLayout ( Layout * layout ) [virtual]
 

Set the Layout for this appender.

Parameters:
layout   The layout to use.

Reimplemented from log4cpp::AppenderSkeleton.

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

Translates a log4cpp priority to a syslog priority.

Parameters:
priority   The log4cpp priority.
Returns:
the syslog priority.


Member Data Documentation

int log4cpp::SyslogAppender::_facility [protected]
 

Layout* log4cpp::SyslogAppender::_layout [protected]
 

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


The documentation for this class was generated from the following file:
Generated at Mon Jun 11 01:25:25 2001 for log4cpp by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001