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

#include <EventLogger.hpp>

Inheritance diagram for EventLogger:
Collaboration diagram for EventLogger:

Public Member Functions

 EventLogger ()
virtual ~EventLogger ()
void close ()
virtual void log (int, const Uint32 *, Uint32 len, NodeId=0, const class LogLevel *=0)
- Public Member Functions inherited from Logger
 Logger ()
virtual ~Logger ()
void setCategory (const char *pCategory)
bool createConsoleHandler (NdbOut &out=ndbout)
void removeConsoleHandler ()
bool createEventLogHandler (const char *source_name)
bool createFileHandler (char *filename=0)
void removeFileHandler ()
bool createSyslogHandler ()
void removeSyslogHandler ()
bool addHandler (LogHandler *pHandler)
bool addHandler (const BaseString &logstring, int *err, int len, char *errStr)
bool removeHandler (LogHandler *pHandler)
void removeAllHandlers ()
bool isEnable (LoggerLevel logLevel) const
void enable (LoggerLevel logLevel)
void enable (LoggerLevel fromLogLevel, LoggerLevel toLogLevel)
void disable (LoggerLevel logLevel)
virtual void alert (const char *pMsg,...) const ATTRIBUTE_FORMAT(printf
virtual void virtual void alert (BaseString &pMsg) const
virtual void critical (const char *pMsg,...) const ATTRIBUTE_FORMAT(printf
virtual void virtual void critical (BaseString &pMsg) const
virtual void error (const char *pMsg,...) const ATTRIBUTE_FORMAT(printf
virtual void virtual void error (BaseString &pMsg) const
virtual void warning (const char *pMsg,...) const ATTRIBUTE_FORMAT(printf
virtual void virtual void warning (BaseString &pMsg) const
virtual void info (const char *pMsg,...) const ATTRIBUTE_FORMAT(printf
virtual void virtual void info (BaseString &pMsg) const
virtual void debug (const char *pMsg,...) const ATTRIBUTE_FORMAT(printf
virtual void virtual void debug (BaseString &pMsg) const
virtual void setRepeatFrequency (unsigned val)

Static Public Member Functions

static const char * getText (char *dst, size_t dst_len, EventTextFunction textF, const Uint32 *theData, Uint32 len, NodeId nodeId=0)
- Static Public Member Functions inherited from EventLoggerBase
static int event_lookup (int eventType, LogLevel::EventCategory &cat, Uint32 &threshold, Logger::LoggerLevel &severity, EventTextFunction &textF)

Additional Inherited Members

- Public Types inherited from EventLoggerBase
typedef void(* EventTextFunction )(char *, size_t, const Uint32 *, Uint32 len)
- Public Types inherited from Logger
enum  LoggerLevel {
  LL_ON, LL_DEBUG, LL_INFO, LL_WARNING,
  LL_ERROR, LL_CRITICAL, LL_ALERT, LL_ALL
}
- Public Attributes inherited from EventLoggerBase
LogLevel m_logLevel
- Static Public Attributes inherited from EventLoggerBase
static const EventRepLogLevelMatrix matrix []
static const Uint32 matrixSize
- Static Public Attributes inherited from Logger
static const char * LoggerLevelNames []
- Protected Member Functions inherited from Logger
void log (LoggerLevel logLevel, const char *msg, va_list ap) const
- Protected Attributes inherited from Logger
NdbMutex * m_mutex

Detailed Description

The EventLogger is primarily used for logging NDB events in the Management Server. It inherits all logging functionality of Logger.

HOW TO USE

1) Create an EventLogger

EventLogger myEventLogger = new EventLogger();

2) Log NDB events and other log messages.

myEventLogger->info("Changing log levels.");

EventReport* report = (EventReport*)&theSignalData[0]; myEventLogger->log(eventReport->getEventType(), theSignalData, aNodeId);

The following NDB event categories and log levels are enabled as default:

EVENT-CATEGORY LOG-LEVEL

Startup 4 Shutdown 1 Statistic 2 Checkpoint 5 NodeRestart 8 Connection 2 Error 15 Info 10

See Also
Logger
Version
#@
Id:
EventLogger.hpp,v 1.3 2003/09/01 10:15:52 innpeno Exp

Definition at line 94 of file EventLogger.hpp.

Constructor & Destructor Documentation

EventLogger::EventLogger ( )

Default constructor. Enables default log levels and sets the log category to 'EventLogger'.

Definition at line 1470 of file EventLogger.cpp.

Here is the call graph for this function:

EventLogger::~EventLogger ( )
virtual

Destructor.

Definition at line 1476 of file EventLogger.cpp.

Member Function Documentation

void EventLogger::close ( void  )

Closes the eventlog.

Definition at line 1481 of file EventLogger.cpp.

Here is the call graph for this function:

const char * EventLogger::getText ( char *  dst,
size_t  dst_len,
EventTextFunction  textF,
const Uint32 *  theData,
Uint32  len,
NodeId  nodeId = 0 
)
static

Returns the event text for the specified event report type.

Parameters
textFprint function for the event
theDatathe event data.
nodeIda node id.
Returns
the event report text.

Definition at line 1519 of file EventLogger.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void EventLogger::log ( int  ,
const Uint32 *  ,
Uint32  len,
NodeId  = 0,
const class LogLevel = 0 
)
virtual

Logs the NDB event.

Parameters
eventTypethe type of event.
theDatathe event data.
nodeIdthe node id of event origin.

Definition at line 1535 of file EventLogger.cpp.

Here is the call graph for this function:


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