Enabling trace on an application client or stand-alone process

Many stand-alone processes and the WebSphere J2EE application client, define a process-specific mechanism for enabling trace. To enable trace and message logging for application clients or processes that have not defined such a mechanism, add the -DtraceSetFile=filename system property to the startup script or command.

For example, to trace the stand-alone client application program named com.ibm.sample.MyClientProgram, enter the command:

java -DtraceSetFile=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/TraceSet.properties .

 

  1. (Optional)  

    Configure the MyTraceSet.properties file to send trace output to a file.

    The traceFileName property in the trace settings file specifies 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 .

  2. (Optional)  

    Specify a trace string for writing messages.

    The Trace String property specifies a startup trace specification, similar to that available on the server.

    For your convenience, enter multiple individual trace strings into the trace settings file, one trace string per line.

 

Results

Here are the results of using each optional property setting:

  • Specify a valid setting for the traceFileName property without a trace string to write messages to the specified file or System.out only.

  • Specify a trace string without a traceFileName property value to generate no output.

  • Specify both a valid traceFileName property and a trace string to write both message and trace entries to the location specified in the traceFileName property.


Enabling trace
Enabling trace at server startup
Enabling trace on a running server

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.