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

Qmms::Log::SyslogAppender Class Reference

Sends LoggingEvents to syslog. More...

#include <log.hh>

Inheritance diagram for Qmms::Log::SyslogAppender::

Qmms::Log::LayoutAppender Qmms::Log::AppenderSkeleton Qmms::Log::Appender List of all members.

Public Methods

 SyslogAppender ()
 Default constructor does nothing. More...

 SyslogAppender (const QString &name, int fac=LOG_USER)
 Constructor to be used in PropertyConfigurator. More...

 SyslogAppender (const QString &name, const QString &syslogName, int fac=LOG_USER)
 Full constructor. More...

virtual ~SyslogAppender ()
 Destructor. More...

void setSyslogName (const QString &str)
 Explicitly sets syslogName. More...

QString getSyslogName () const
 Accessor method. More...

int getFacility () const
 Accessor method. More...

void subAppend (LoggingEvent *evnt)
 Logs event immediately with no further checks. More...


Static Public Methods

int toSyslogLevel (QString p)
 Maps a qmmslog loglevel to a syslog level by the following:
 8 - getValue(p) / 100
 
.
More...



Protected Methods

virtual void open ()
 Calls openlog(). More...

virtual void close ()
 Calls closelog();. More...

virtual bool reopen ()
 Calls close(), then open(). More...


Protected Attributes

QString syslogName
 The ident parameter to be sent to openlog(). More...

int facility
 The syslog facility, i.e., the type of program logging the message. More...

Layout * layout
 The Layout to use with this Appender. More...


Static Protected Attributes

const int loglevels [8]
 The list of syslog levels: <. More...


Detailed Description

Sends LoggingEvents to syslog.


Constructor & Destructor Documentation

Qmms::Log::SyslogAppender::SyslogAppender (    ) 
 

Default constructor does nothing.

Qmms::Log::SyslogAppender::SyslogAppender (  const QString &    name,
int    fac = LOG_USER
) 
 

Constructor to be used in PropertyConfigurator.

syslogName must be set explicitly. facility is set to LOG_USER.

Parameters:
name  the name of the Appender
fac  the facility (defaults to LOG_USER)

Qmms::Log::SyslogAppender::SyslogAppender (  const QString &    name,
const QString &    syslogName,
int    fac = LOG_USER
) 
 

Full constructor.

Parameters:
name  the name of this Appender
syslogName  the ident parameter in the openlog() call. Usually the name of the application itself.
fac  the facility (default is LOG_USER)

virtual Qmms::Log::SyslogAppender::~SyslogAppender (    )  [virtual]
 

Destructor.

Calls close().


Member Function Documentation

virtual void Qmms::Log::SyslogAppender::close (    )  [protected, virtual]
 

Calls closelog();.

Reimplemented from Qmms::Log::Appender.

int Qmms::Log::SyslogAppender::getFacility (    )  const
 

Accessor method.

Returns:
the syslog facility as an integer

QString Qmms::Log::SyslogAppender::getSyslogName (    )  const
 

Accessor method.

Returns:
syslogName (the ident parameter sent to syslog)

virtual void Qmms::Log::SyslogAppender::open (    )  [protected, virtual]
 

Calls openlog().

virtual bool Qmms::Log::SyslogAppender::reopen (    )  [protected, virtual]
 

Calls close(), then open().

Returns:
true

void Qmms::Log::SyslogAppender::setSyslogName (  const QString &    str ) 
 

Explicitly sets syslogName.

Meant to be used by PropertyConfigurator since syslogName is read from a different line from that which creates the Appender.

Parameters:
str  reference to the ident parameter in the openlog() call. Usually the name of the application doing the logging.

void Qmms::Log::SyslogAppender::subAppend (  LoggingEvent *    evnt )  [virtual]
 

Logs event immediately with no further checks.

Calls syslog().

Parameters:
evnt  the LoggingEvent to log

Reimplemented from Qmms::Log::LayoutAppender.

int Qmms::Log::SyslogAppender::toSyslogLevel (  QString    p )  [static]
 

Maps a qmmslog loglevel to a syslog level by the following:

 8 - getValue(p) / 100
 
.

Parameters:
p  the key of the qmmslog level to map
Returns:
the syslog level


Member Data Documentation

int Qmms::Log::SyslogAppender::facility [protected]
 

The syslog facility, i.e., the type of program logging the message.

Can be any one of the following:

LOG_AUTH, LOG_AUTHPRIV, LOG_CRON, LOG_DAEMON, LOG_FTP, LOG_KERN, LOG_LOCAL0 through LOG_LOCAL7, LOG_LPR, LOG_MAIL, LOG_NEWS, LOG_SYSLOG, LOG_USER (default), LOG_UUCP.

Layout* Qmms::Log::SyslogAppender::layout [protected]
 

The Layout to use with this Appender.

Reimplemented from Qmms::Log::LayoutAppender.

const int Qmms::Log::SyslogAppender::loglevels[8] [static, protected]
 

The list of syslog levels: <.

p> LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG

QString Qmms::Log::SyslogAppender::syslogName [protected]
 

The ident parameter to be sent to openlog().

Usually the name of the program.


The documentation for this class was generated from the following file:
Generated on Fri Jan 3 15:04:10 2003 for QmmsLog by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001