This section provides information about the functions available in the MGM API for controlling the output of the cluster log.
- Description
This function is used to retrieve the cluster log severity filter currently in force.
- Signature
int ndb_mgm_get_clusterlog_severity_filter ( NdbMgmHandle handle, struct ndb_mgm_severity* severity, unsigned int size )- Parameters
-
An
NdbMgmHandle.A vector
severityof seven (NDB_MGM_EVENT_SEVERITY_ALL) elements, each of which is anndb_mgm_severitystructure, where each element contains1if a severity indicator is enabled and0if not. A severity level is stored at positionndb_mgm_clusterlog_level; for example the error level is stored at positionNDB_MGM_EVENT_SEVERITY_ERROR. The first element (positionNDB_MGM_EVENT_SEVERITY_ON) in the vector signals whether the cluster log is disabled or enabled.The
sizeof the vector (NDB_MGM_EVENT_SEVERITY_ALL).
- Return value
The number of returned severities, or
-1in the event of an error.
- Description
This function is used to set a cluster log severity filter.
- Signature
int ndb_mgm_set_clusterlog_severity_filter ( NdbMgmHandle handle, enum ndb_mgm_event_severity severity, int enable, struct ndb_mgm_reply* reply )- Parameters
-
This function takes 4 parameters:
A management server
handle.A cluster log
severityto filter.A flag to
enableor disable the filter;1enables and0disables the filter.A pointer to an
ndb_mgm_replystructure for a reply message.
- Return value
The function returns
-1in the event of failure.
- Description
This function is used to obtain log category and level information, and is thread-safe.
- Signature
int ndb_mgm_get_clusterlog_loglevel ( NdbMgmHandle handle, struct ndb_mgm_loglevel* loglevel, unsigned int size )- Parameters
-
ndb_mgm_get_clusterlog_loglevel()takes the following parameters:A management
handle(NdbMgmHandle).A
loglevel(log level) vector consisting of twelve elements, each of which is anndb_mgm_loglevelstructure and which represents a log level of the corresponding category.The
sizeof the vector (MGM_LOGLEVELS).
- Return value
This function returns the number of returned loglevels or
-1in the event of an error.
- Description
This function is used to set the log category and levels for the cluster log.
- Signature
int ndb_mgm_set_clusterlog_loglevel ( NdbMgmHandle handle, int id, enum ndb_mgm_event_category category, int level, struct ndb_mgm_reply* reply)- Parameters
-
This function takes 5 parameters:
An
NdbMgmHandle.The
idof the node affected.An event
categorymdash;this is one of the values listed in The ndb_mgm_event_category Type .A logging
level.A pointer to an
ndb_mgm_replystructure for thereplymessage.
- Return value
In the event of an error, this function returns
-1.