MySQL NDB Cluster API Developer Guide  /  ...  /  Cluster Log Functions

3.2.7 Cluster Log Functions

This section provides information about the functions available in the MGM API for controlling the output of the cluster log.

ndb_mgm_get_clusterlog_severity_filter()

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 severity of seven (NDB_MGM_EVENT_SEVERITY_ALL) elements, each of which is an ndb_mgm_severity structure, where each element contains 1 if a severity indicator is enabled and 0 if not. A severity level is stored at position ndb_mgm_clusterlog_level; for example the error level is stored at position NDB_MGM_EVENT_SEVERITY_ERROR. The first element (position NDB_MGM_EVENT_SEVERITY_ON) in the vector signals whether the cluster log is disabled or enabled.

  • The size of the vector (NDB_MGM_EVENT_SEVERITY_ALL).

Return value

The number of returned severities, or -1 in the event of an error.

ndb_mgm_set_clusterlog_severity_filter()

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 severity to filter.

  • A flag to enable or disable the filter; 1 enables and 0 disables the filter.

  • A pointer to an ndb_mgm_reply structure for a reply message.

Return value

The function returns -1 in the event of failure.

ndb_mgm_get_clusterlog_loglevel()

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 an ndb_mgm_loglevel structure and which represents a log level of the corresponding category.

  • The size of the vector (MGM_LOGLEVELS).

Return value

This function returns the number of returned loglevels or -1 in the event of an error.

ndb_mgm_set_clusterlog_loglevel()

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 id of 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_reply structure for the reply message.

Return value

In the event of an error, this function returns -1.