Enable trace on client and standalone applications

When standalone client applications (such as Java applications which access EJBs hosted in WAS) have problems interacting with WAS, it may be useful to enable tracing for the application. Enabling trace for client programs will cause the WebSphere Application Server classes used by those applications, such as naming-service client classes, to generate trace information. A common troubleshooting technique is to enable tracing on both the appserver and client applications, and match records according to timestamp to try to understand where a problem is occurring.

  1. To enable trace for the WAS classes in a client application, add the DtraceSettingsFile=filename system property to the startup script or command of the client application. The location of the output and the classes and detail included in the trace follow the same rules as for adding trace to WASs. For example, trace the standalone client application program named com.ibm.sample.MyClientProgram, you would enter the following command

    java -DtraceSettingsFile=MyTraceSettings.properties com.ibm.samples.MyClientProgram
    The file identified by filename must be a properties file placed in the classpath of the application client or stand-alone process. An example file is provided in $WAS_HOME/properties/TraceSettings.properties.

  2. You can configure the MyTraceSettings.properties file to send trace output to a file using the traceFileName property. Specify one of two options...

    • The fully qualified name of an output file. For example, traceFileName=c:\\MyTraceFile.log. You must specify this property to generate visible output.

    • stdout. When specified, output is written to System.out.

  3. You can also specify a trace string for writing messages with the Trace String property, Specify a startup trace specification similar to that available on the server.For your convenience, you can enter multiple individual trace strings into the trace settings file, one trace string per line.

Here are the results of using each optional property setting...