Example: Enable logging and tracing for activeX client applications
The ActiveX to EJB bridge provides two logging and tracing formats: Windows Application Event Log and Java Trace Log.
- Windows Event Log
The Windows Application Event Log shows JNI errors, Java console error messages, and XJB initialization messages. This log is most useful for determining XJBInit() errors and any unusual exceptions that do not come from the Java environment. By default, critical error logging will be enabled and debug and event logging is disabled.
To enable or disable logging of certain event types to the Windows Event Log, specify one or more parameters to XJBInit(). If more than one parameter is set, they will be processed in the order in which they appear in the input string array to the XJBInit() method. Once the XJBInit() method is initialized, these parameters can no longer be set/reset for the life of the process. Using Java java.lang.System.setProperty() to set these values also has no effect.
- Dcom.ibm.ws.client.xjb.native.logging.debug=enabled|disabled
Enables or disables debug level messages from displaying in the Windows operating system event log. This level of logging is most useful and shows most internal errors, user programming issues or configuration problems.
- Dcom.ibm.ws.client.xjb.native.logging.event=enabled|disabled
Enables or disables event level messages from appearing in the Windows operating system event log.
- Dcom.ibm.ws.client.xjb.native.logging.*=enabled|disabled
Enables or disables both event and debug level messages from appearing in the Windows operating system event log. It is not possible to disable some critical error messages from being displayed in the error log. Only debug and event level messages can be disabled.
To view the Windows application event log with the Event Viewer...
- Click Start > Control Panel.
- Double-click Administrative Tools.
- Double-click Event Viewer.
All ActiveX to EJB bridge events display the text WebSphere XJB in the source column and in the application log.
When using the Event Viewer, we can get help information by clicking the menu choice Action > Help.
- Java trace log
The Java trace log displays information that we can use to debug method calls, class lookups, and argument coercion problems. Because the Java portion of the bridge mirrors the function of the COM IDispatch interface, the information in the trace log is similar to what we have come to expect from an IDispatch interface. To understand the trace log, we need a fundamental understanding of IDispatch.
To enable user-logging, add the following parameters to the XJBInit() input string array:
"-DtraceString=com.ibm.ws.client.xjb.*=event=enabled" "-DtraceFile=C:\MyTrace.txt"
Related tasks
Develop ActiveX client application code