MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SysLogHandler Class Reference

#include <SysLogHandler.hpp>

Inheritance diagram for SysLogHandler:
Collaboration diagram for SysLogHandler:

Public Member Functions

 SysLogHandler ()
 SysLogHandler (const char *pIdentity, int facility)
virtual ~SysLogHandler ()
virtual bool open ()
virtual bool close ()
virtual bool is_open ()
virtual bool setParam (const BaseString &param, const BaseString &value)
bool setFacility (const BaseString &facility)
- Public Member Functions inherited from LogHandler
 LogHandler ()
virtual ~LogHandler ()
virtual const char * handler_type ()
void append (const char *pCategory, Logger::LoggerLevel level, const char *pMsg)
void append_impl (const char *pCategory, Logger::LoggerLevel level, const char *pMsg)
const char * getDefaultHeader (char *pStr, const char *pCategory, Logger::LoggerLevel level) const
const char * getDefaultFooter () const
const char * getDateTimeFormat () const
void setDateTimeFormat (const char *pFormat)
int getErrorCode () const
void setErrorCode (int code)
char * getErrorStr ()
void setErrorStr (const char *str)
bool parseParams (const BaseString &params)
virtual bool checkParams ()
virtual void setRepeatFrequency (unsigned val)
virtual bool getParams (BaseString &config)
virtual off_t getCurrentSize ()
virtual off_t getMaxSize ()

Protected Member Functions

virtual void writeHeader (const char *pCategory, Logger::LoggerLevel level)
virtual void writeMessage (const char *pMsg)
virtual void writeFooter ()
- Protected Member Functions inherited from LogHandler
 STATIC_CONST (MAX_DATE_TIME_HEADER_LENGTH=64)
 STATIC_CONST (MAX_HEADER_LENGTH=128)
 STATIC_CONST (MAX_FOOTER_LENGTH=128)

Detailed Description

Logs messages to syslog. The default identity is 'NDB'. See 'man 3 syslog'.

It logs the following severity levels.

 LOG_ALERT           A condition  that  should  be  corrected
                     immediately,  such as a corrupted system
                     database.
 LOG_CRIT            Critical conditions, such as hard device
                     errors.
 LOG_ERR             Errors.
 LOG_WARNING         Warning messages.
 LOG_INFO            Informational messages.
 LOG_DEBUG           Messages that contain  information  nor-
                     mally  of use only when debugging a pro-
                     gram.
See Also
LogHandler
Version
#@
Id:
SysLogHandler.hpp,v 1.2 2003/09/01 10:15:53 innpeno Exp

Definition at line 51 of file SysLogHandler.hpp.

Constructor & Destructor Documentation

SysLogHandler::SysLogHandler ( )

Default constructor.

Definition at line 28 of file SysLogHandler.cpp.

SysLogHandler::SysLogHandler ( const char *  pIdentity,
int  facility 
)

Create a new syslog handler with the specified identity.

Parameters
pIdentitya syslog identity.
facilitysyslog facility, defaults to LOG_USER

Definition at line 36 of file SysLogHandler.cpp.

SysLogHandler::~SysLogHandler ( )
virtual

Destructor.

Definition at line 45 of file SysLogHandler.cpp.

Member Function Documentation

bool SysLogHandler::close ( )
virtual

Closes/free any allocated resources used by the log handler.

Returns
true if successful.

Implements LogHandler.

Definition at line 59 of file SysLogHandler.cpp.

bool SysLogHandler::is_open ( )
virtual

Check if LogHandler is open

Returns
true if open.

Implements LogHandler.

Definition at line 67 of file SysLogHandler.cpp.

bool SysLogHandler::open ( )
virtual

Opens/initializes the log handler.

Returns
true if successful.

Implements LogHandler.

Definition at line 50 of file SysLogHandler.cpp.

bool SysLogHandler::setParam ( const BaseString param,
const BaseString value 
)
virtual

Sets a parameters. What parameters are accepted depends on the subclass.

Parameters
paramname of parameter
valuevalue of parameter

Implements LogHandler.

Definition at line 119 of file SysLogHandler.cpp.

void SysLogHandler::writeFooter ( )
protectedvirtual

Write the footer to the log.

Implements LogHandler.

Definition at line 112 of file SysLogHandler.cpp.

void SysLogHandler::writeHeader ( const char *  category,
Logger::LoggerLevel  level 
)
protectedvirtual

Write the header to the log.

Parameters
pCategorythe category to tag the log with.
levelthe log level.

Implements LogHandler.

Definition at line 73 of file SysLogHandler.cpp.

void SysLogHandler::writeMessage ( const char *  pMsg)
protectedvirtual

Write the message to the log.

Parameters
pMsgthe message to log.

Implements LogHandler.

Definition at line 106 of file SysLogHandler.cpp.


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