MySQL 5.6.14 Source Code Document
|
#include <EventLogger.hpp>
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 |
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
Definition at line 94 of file EventLogger.hpp.
EventLogger::EventLogger | ( | ) |
Default constructor. Enables default log levels and sets the log category to 'EventLogger'.
Definition at line 1470 of file EventLogger.cpp.
|
virtual |
Destructor.
Definition at line 1476 of file EventLogger.cpp.
void EventLogger::close | ( | void | ) |
Closes the eventlog.
Definition at line 1481 of file EventLogger.cpp.
|
static |
Returns the event text for the specified event report type.
textF | print function for the event |
theData | the event data. |
nodeId | a node id. |
Definition at line 1519 of file EventLogger.cpp.
|
virtual |
Logs the NDB event.
eventType | the type of event. |
theData | the event data. |
nodeId | the node id of event origin. |
Definition at line 1535 of file EventLogger.cpp.