log4cpp  1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
log4cpp::RemoteSyslogAppender Class Reference

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

#include <RemoteSyslogAppender.hh>

Inheritance diagram for log4cpp::RemoteSyslogAppender:
log4cpp::LayoutAppender log4cpp::AppenderSkeleton log4cpp::Appender

List of all members.

Public Member Functions

 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.
virtual ~RemoteSyslogAppender ()
virtual bool reopen ()
 Closes and reopens the socket.
virtual void close ()
 Closes the socket.

Static Public Member Functions

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

Protected Member Functions

virtual void open ()
 Just creates the socket.
virtual void _append (const LoggingEvent &event)
 Sends a LoggingEvent to the remote syslog.

Protected Attributes

const std::string _syslogName
const std::string _relayer
int _facility
int _portNumber
SOCKET _socket
in_addr_t _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:
nameThe name of the Appender
syslogNameThe ident parameter in the openlog(3) call.
relayerThe IP address or hostname of a standard syslog host.
facilityThe syslog facility to log to. Defaults to LOG_USER. Value '-1' implies to use the default.
portNumberAn alternative port number. Defaults to the standard syslog port number (514). Value '-1' implies to use the default.

Member Function Documentation

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

Sends a LoggingEvent to the remote syslog.

Parameters:
eventthe LoggingEvent to log.

Implements log4cpp::AppenderSkeleton.

Closes the socket.

Implements log4cpp::AppenderSkeleton.

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

Just creates the socket.

Closes and reopens the socket.

Reimplemented from log4cpp::AppenderSkeleton.

Translates a log4cpp priority to a syslog priority.

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

Member Data Documentation

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

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines