Logging and tracing with the IMS resource adapter

The IMS resource adapter, in addition to other J2EE components, provides controls for logging and tracing component information. When these controls are set for logging and tracing and you run your Java™ application using the WebSphere® Unit Test Environment, a trace file is created.

Note: Ensure that only one client is running when the trace is on.

To set controls for logging and tracing, complete the following steps:

  1. In the Server Configuration view, double-click your server configuration to open the WebSphere Server Configuration editor.
  2. Select the J2C tab in the editor.
  3. On the J2C Options page, select an IMS resource adapter in the J2C Resource Adapters table.
  4. Scroll down to the J2C Connection Factories table and select the connection factory for which you want to turn the trace on.
  5. Scroll down to the Resource Properties table and select the TraceLevel resource property. Specify a non-zero value to enable logging and tracing. TraceLevel values correspond to constants in the interface com.ibm.connector2.ims.ico.IMSTraceLevelProperties.
    TraceLevel Value IMSTraceLevelProperties Description
    0 RAS_TRACE_OFF No tracing or logging occurs.
    1 RAS_TRACE_ERROR_EXCEPTION Only errors and exceptions are logged.
    2 RAS_TRACE_ENTRY_EXIT Errors and exceptions plus the entry and exit of important methods are logged.
    3 RAS_TRACE_INTERNAL Errors and exceptions, the entry and exit of important methods, and the contents of buffers sent to and received from IMS Connect are logged.
  6. After entering the TraceLevel value on the page for the J2C tab, select the Trace tab.
  7. Ensure that the Enable trace check box is selected. To enable logging and tracing in the IMS Resource adapter, enter the following in the Trace string field:
    com.ibm.connector2.ims.*=all=enabled
    com.ibm.ims.ico.*=all=enabled
    Other combinations of trace strings will enable tracing in other components. For example, with the following trace string:
    com.ibm.ejs.j2c.*=all=enabled:com.ibm.connector2.*=all=enabled

    the string com.ibm.ejs.j2c.* provides you with logging and tracing of WebSphere's implementation of the J2EE Connector Architecture and the string com.ibm.connector2.* provides you with logging and tracing of all of the resource adapters, including IMS™.

  8. You can accept the default name and location of the trace output file or you can modify it. For example, depending on how you set your substitution variables, the default name and location might be:
    your_workspace\.metadata\.plugins\com.ibm.etools.server.core
    \tmp0\logs\server1\trace.log
    To modify the default name and location, enter a different name and location of the file in the Trace output file field on the Trace Options page of the server configuration.
  9. When you are finished making changes, close the editor and select Yes to save your changes.
  10. Check the Status column of the Servers view and restart the server instance, if necessary. You will most likely have to restart the server instance if you are using the WebSphere Test Environment.
  11. Run your Java application and then examine the trace file.
Related reference
Diagnosing problems when using the IMS resource adapter
J2CA0056I, WLTC0017E, HWSP1445E, and HWSSL00E Error Messages
IMS resource adapter messages and exceptions
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.