A connector can send information about its state to a log
destination. The following types of information are recommended for
logging:
- Errors and fatal errors
from your code to a log file.
- Warnings require a system
administrator's attention, from your code to a log file.
- Informational messages such
as:
- Connector startup and termination messages
- Important messages from the application
Although a connector can send informational or error messages,
this logging process is referred to as error logging.
- Note:
- These messages are independent of any trace messages defined
for the connector.
A connector sends its log messages into its log destination. The
log is an external destination that is available for viewing
by those needing to review the execution state of the connector.
The log destination is defined at connector configuration time by
the setting of the Logging field in the Trace/Log Files tab of
Connector Configurator as one of the following:
- To File: The absolute pathname of an external file, which must
reside on the same machine as the connector's process (with its
connector framework and application-specific component)
- To console (STDOUT): The command prompt window generated when
the connector startup script
starts the connector
By default, the connector's log destination is set to the
console, which indicates use of the startup script's command prompt
window as the log destination. Set this log destination as
appropriate for your connector.
WebSphere InterChange Server |
You can also set the
LogAtInterchangeEnd
connector configuration property to indicate whether messages are
also logged to the InterChange Server's log destination:
- Messages logged locally only:
LogAtInterchangeEnd is false.
- Messages are logged both locally and sent to InterChange
Server's log destination: LogAtInterchangeEnd is
true.
By default, LogAtInterchangeEnd is set to
false, so that messages are only logged locally. If
messages are sent to InterChange Server, they are written to the
destination specified for InterChange Server messages.
- Note:
- Logging to InterChange Server's log destination also turns on
email notification, which generates email messages for the MESSAGE_RECIPIENT parameter
specified in the InterchangeSystem.cfg file when errors or
fatal errors occur. As an example, when a connector loses its
connection to its application, if LogAtInterchangeEnd is
set to true, an email message is sent to the specified message
recipient.
|
These connector properties are set with Connector Configurator.
For more information on InterChange Server's message logging, see
the System Administration Guide in the IBM WebSphere
InterChange Server documentation set.
Table 46 shows the ways
that a connector sends an error, warning, and information message
to its log destination.
Table 46. Methods for sending a message
to the log destination
Connector
library method |
Description |
logMsg() and generateMsg()
|
Takes as
input a text string or a string generated from a message in a
message file. Optionally, it can take a message-type constant to
indicate whether the message is an error, warning, or
informational. To generate a character string from the message text
in a message file, use the generateMsg() method. |
generateAndLogMsg()
|
Combines the
functionality of the logMsg() and generateMsg()
methods into a single call. |
For more information on how to generate a message, see "Generating a message
string".
In the C++ connector library, the logMsg(),
generateMsg(), and generateAndLogMsg() methods
are defined in two classes:
- In the
GenGlobals for access to logging from within the connector
base class
- In the
BOHandlerCPP class for access to logging from within a
business object handler.
Both the generateMsg() and generateAndLogMsg()
methods require a message type as an argument. This argument
indicates the severity of the message. For more information, see
"Generating a message
string".
