db2AdminMsgWrite API - Write log messages for administration and replication function

Provides a mechanism for users and Replication to write information to the db2diag log file, and the administration notification log.

Authorization

None

Required connection

None

API include file

db2ApiDf.h

API and data structure syntax

SQL_API_RC SQL_API_FN
  db2AdminMsgWrite (
   db2Uint32 versionNumber,
   void * pParmStruct,
   struct sqlca * pSqlca);

typedef struct db2AdminMsgWriteStruct
{
   db2Uint32 iMsgType;
   db2Uint32 iComponent;
   db2Uint32 iFunction;
   db2Uint32 iProbeID;
   char *piData_title;
   void *piData;
   db2Uint32 iDataLen;
   db2Uint32 iError_type;
} db2AdminMsgWriteStruct;

db2AdminMsgWrite API parameters

versionNumber
Input. Specifies the version and release level of the structure passed in as the second parameter, pParmStruct.
pParmStruct
Input. A pointer to the db2AdminMsgWriteStruct structure.
pSqlca
Output. A pointer to the sqlca structure.

db2AdminMsgWriteStruct data structure parameters

iMsgType
Input. Specify the type of data to be logged. Valid values are BINARY_MSG for binary data, and STRING_MSG for string data.
iComponent
Input. Specify zero.
iFunction
Input. Specify zero.
iProbeID
Input. Specify the numeric probe point. Numeric probe point is a unique internal identifier that is used to locate the point in the source code that reported the message.
piData_title
Input. A pointer to the title string describing the data to be logged. Can be set to NULL if a title is not needed.
piData
Input. A pointer to the data to be logged. Can be set to NULL if data logging is not needed.
iDataLen
Input. The number of bytes of binary data to be used for logging if iMsgType is BINARY_MSG. Not used if iMsgType is STRING_MSG.
iError_type
Input. Valid values are:
  • DB2LOG_SEVERE_ERROR: (1) Severe error has occurred
  • DB2LOG_ERROR: (2) Error has occurred
  • DB2LOG_WARNING: (3) Warning has occurred
  • DB2LOG_INFORMATION: (4) Informational

Usage notes

This API will log to the administration notification log only if the specified error type is less than or equal to the value of the notifylevel database manager configuration parameter. It will log to the db2diag log file only if the specified error type is less than or equal to the value of the diaglevel database manager configuration parameter. However, all information written to the administration notification log is duplicated in the db2diag log file, unless the diaglevel database manager configuration parameter is set to zero.