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

log4cpp::RemoteSyslogAppender Class Reference

RemoteSyslogAppender sends LoggingEvents to a remote syslog system. More...

#include <RemoteSyslogAppender.hh>

Inheritance diagram for log4cpp::RemoteSyslogAppender:

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

Collaboration graph
[legend]
List of all members.

Public Methods

 RemoteSyslogAppender (const std::string &name, const std::string &syslogName, const std::string &relayer, int facility=LOG_USER, int portNumber=514)
 Instantiate a RemoteSyslogAppender with given name and name and facility for syslog. More...

virtual ~RemoteSyslogAppender ()
virtual bool reopen ()
 Closes and reopens the socket. More...

virtual void close ()
 Closes the socket. More...


Static Public Methods

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


Protected Methods

virtual void open ()
 Just creates the socket. More...

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


Protected Attributes

const std::string _syslogName
const std::string _relayer
int _facility
int _portNumber
int _socket
unsigned long _ipAddr

Detailed Description

RemoteSyslogAppender sends LoggingEvents to a remote syslog system.

Also see: draft-ietf-syslog-syslog-12.txt


Constructor & Destructor Documentation

log4cpp::RemoteSyslogAppender::RemoteSyslogAppender const std::string &    name,
const std::string &    syslogName,
const std::string &    relayer,
int    facility = LOG_USER,
int    portNumber = 514
 

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

Parameters:
name  The name of the Appender
syslogName  The ident parameter in the openlog(3) call.
relayer  The IP address or hostname of a standard syslog host.
facility  The syslog facility to log to. Defaults to LOG_USER. Value '-1' implies to use the default.
portNumber  An alternative port number. Defaults to the standard syslog port number (514). Value '-1' implies to use the default.

log4cpp::RemoteSyslogAppender::~RemoteSyslogAppender   [virtual]
 


Member Function Documentation

void log4cpp::RemoteSyslogAppender::_append const LoggingEvent   event [protected, virtual]
 

Sends a LoggingEvent to the remote syslog.

Parameters:
event  the LoggingEvent to log.

Implements log4cpp::AppenderSkeleton.

void log4cpp::RemoteSyslogAppender::close   [virtual]
 

Closes the socket.

Implements log4cpp::AppenderSkeleton.

void log4cpp::RemoteSyslogAppender::open   [protected, virtual]
 

Just creates the socket.

bool log4cpp::RemoteSyslogAppender::reopen   [virtual]
 

Closes and reopens the socket.

Reimplemented from log4cpp::AppenderSkeleton.

int log4cpp::RemoteSyslogAppender::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::RemoteSyslogAppender::_facility [protected]
 

unsigned long log4cpp::RemoteSyslogAppender::_ipAddr [protected]
 

int log4cpp::RemoteSyslogAppender::_portNumber [protected]
 

const std::string log4cpp::RemoteSyslogAppender::_relayer [protected]
 

int log4cpp::RemoteSyslogAppender::_socket [protected]
 

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


The documentation for this class was generated from the following files:
Generated on Mon Oct 28 23:42:15 2002 for log4cpp by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002