Tracing assists developers and troubleshooters. Due to the significant performance
cost incurred by tracing, however, many customers disable it in production
environments. When developing or troubleshooting, it is good practice to check
whether tracing is enabled before building to generate trace messages. You can do
this by checking method
LogUtils.isTraceEnabled(
java.util.logging.Level
)
before building the adapter. The following is an example:
if(logUtils.isTraceEnabled(Level.Fine) {
getLogUtils().trace(...);
Log messages:
Log messages convey timely information intended for consumption by customers:
warnings about potential problems, errors that have occurred and suggested fixes
for those errors, and information that is necessary or helpful to understanding how
the adapter operates.
Message files
To facilitate translation of log messages for different user groups, place all log
messages in a resource bundle file rather than hard-code them in the adapter itself.
The convention for packaging this bundle file is to embed it in the adapter RAR as
<adapter package>.emd/logMessages.properties
.
The message file can contain one or more messages. Each message should be
comprised of three parts:
v
Message Identifier
– The message ID follows the format
NNNNNmmmmS
,
where
NNNNN
is a five-letter component prefix,
mmmm
is the message number,
and
S
identifies the message type. For example, a message identifier such as
ABCDE0001E
has a component identifier of
ABCDE
and a message number of
0001
.
The message type
E
tells you this is an error message. The component identifier
must be registered with IBM to avoid conflicts between products. The type
identifier should conform to one of the values specified in the Log Level table
shown below. The message number is left to you.
v
Explanation
– The explanation provides an in-depth description of the message.
Assume that the customer is unfamiliar with the meaning of the base message.
The explanation is the first level of help documentation for users, not a crutch
for a poorly written base message.
v
User Action
– For every explanation of what went wrong, there usually are
actions that customers can take to rectify the situation or to ensure that it
doesn’t happen again. The User Action field provides detailed information on
what customers can do and is very much like first-level help documentation.
The following is an example of a message file:
0001=CWYBS0001I: Adapter {1} started.
0001.explanation=The adapter has successfully initialized and is now ready to service requests.
0001.useraction=
0004=CWYBS9999E: Failed to establish connection link to server on host {1}.
0004.explanation=The adapter is unable to contact the backend application.
Business data cannot be exchanged with the backend until this issue is resolved.
0004.useraction= Check your adapter configuration and ensure that the
specified host and port match the machine and port on which the backend is listening.
If correct, check that your backend application is on-line and accepting requests.
178
WebSphere Adapters: WebSphere Adapter Toolkit User Guide
Summary of Contents for WebSphere Adapters
Page 2: ......
Page 6: ...iv WebSphere Adapters WebSphere Adapter Toolkit User Guide...
Page 220: ...214 WebSphere Adapters WebSphere Adapter Toolkit User Guide...
Page 224: ...218 WebSphere Adapters WebSphere Adapter Toolkit User Guide...
Page 225: ......
Page 226: ...Printed in USA...