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 Rational Unit Test Environment, a trace file is created.

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

You can use either a WebSphere test environment or a WebSphere Application Server instance to set controls for logging and tracing. The following steps describe how to set controls in both environments.

  1. If you are using a WebSphere v5.x test environment, complete the following steps:
    1. In the Web view, select the Servers tab.
    2. Double-click your test environment to open the Rational Server Configuration editor.
    3. Select the J2C tab in the editor.
    4. On the J2C Options page, select an IMS resource adapter in the J2C Resource Adapters table.
    5. Scroll down to the J2C Connection Factories table and select the connection factory for which you want to turn on the trace.
    6. 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.
    7. After entering the TraceLevel value on the page for the J2C tab, select the Trace tab.
    8. 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™.

    9. 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 for a WebSphere v5.x test environment.
    10. When you are finished making changes, close the editor and select Yes to save your changes.
    11. Check the Status column of the Servers tab and restart the server instance, if necessary. You will most likely have to restart the server instance if you are using the Rational Test Environment.
    12. Run your Java application and then examine the trace file.
  2. If you are using a WebSphere Application Server v6.0 server instance, complete the following steps:
    1. In the Servers view, right-click the server and select Run administrative console. The Administrative Client logon window opens in the Web Browser view.
    2. Type the user ID for the administration console. This user ID can be anything. It is only needed for logging purposes.
    3. In the left pane, click Resource Adapters and select your resource adapter.
    4. Click J2C connection factories and select the connection factory whose trace is to be turned on.
    5. Select Custom properties.
    6. Select TraceLevel.
    7. 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.
    8. Click OK.
    9. Click the Save link.
    10. Click the Save button.
    11. To enter a trace string to set the trace specifications to the desired state, select Troubleshooting > Logs and Traces in the console navigation tree.
    12. Select a server name and click Change Log Level Details.
    13. To enable the logging and tracking in the IMS Resource adapter, enter the following in the trace string box:
      com.ibm.connector2.ims.*=all
      com.ibm.ims.ico.*=all
    14. Select Apply, then click OK.
    15. Navigate to Troubleshooting > Logs and Traces > server_name > Diagnostic Trace.
    16. Select Enable Log on the Configuration tab, if it is not already selected.
    17. 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
    18. Click the Runtime tab and select Save runtime changes to configuration as well, if it is not already selected.
    19. Click OK.
    20. Check the Status column of the Servers tab and restart the server instance, if necessary. You will most likely have to restart the server instance if you are using the Rational Test Environment.
    21. Run your Java application and then examine the trace file.
Related reference
Diagnosing problems when using the IMS resource adapter
J2CA0294W, J2CA0056I, WLTC0017E, HWSP1445E, and HWSSL00E Error Messages
IMS resource adapter messages and exceptions
Terms of use | Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.