logMsg()

Logs a message to the connector's log destination. Log messages must be contained in a message file that you provide for your connector.

Syntax

void logMsg(char * msg);
 void logMsg(char * msg, int severity);
 

Parameters

msg [in]
Is a pointer to the message.
severity[in]
Is one of the following message types:
XRD_WARNING
 
  
 XRD_ERROR
 
  
 XRD_FATAL
 
  
 XRD_INFO
 
  
 XRD_TRACE
 
 

Return values

None.

Notes

The logMsg() method sends the specified msg text to the log destination. You establish the name of a connector's log destination through the Logging section in the Trace/Log File tab of Connector Configurator.

IBM recommends that log messages be contained in a message file and extracted with the generateMsg() method. This message file should be the connector message file, which contains messages specific to your connector. The generateMsg() method generates the message string for logMsg(). It retrieves a predefined message from a message file, formats the text, and returns a generated message string.

Note:
You can use the generateAndLogMsg() method to combine the message generation and logging steps.
WebSphere InterChange Server

If severity is XRD_ERROR or XRD_FATAL and the connector configuration property LogAtInterchangeEnd is set, the error message is logged and an email notification is sent when email notification is on. See the System Administration Guide in the IBM WebSphere InterChange Server documentation set for information on how to set up email notification for errors.

Connector messages logged with logMsg() are viewable using LogViewer if the message strings were generated with generateMsg().

Examples

if ((form = CreateMainForm(conn, getFormName(theObj))) < 0) {
    msg = generateMsg(10, CxMsgFormat::XRD_FATAL, NULL, 0, NULL);
    logMsg(msg);
 }
 

See also

See the description of the GenGlobals::generateMsg() utility.

Copyright IBM Corp. 1997, 2003