Enable trace on client and stand-alone applications


 

+

Search Tips   |   Advanced Search

 

When stand-alone client applications (such as Java applications which access enterprise beans hosted in WAS) have problems interacting with WAS, it might be useful to enable tracing for the application. Enabling trace for client programs will cause the WAS 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.

 

Enable trace for the WAS classes in a client application.

Add the system properties shown in the following example 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 stand-alone client application program named com.ibm.sample.MyClientProgram...

 java -DtraceSettingsFile=MyTraceSettings.properties 
     -Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager 
     -Djava.util.logging.configureByServer=true 
     com.ibm.samples.MyClientProgram

The file identified by file name must be a properties file placed in the class path of the application client or stand-alone process. You must create a trace properties file by copying the %install_root\properties\TraceSettings.properties file to the same directory as the client application JAR file.

We cannot use the -DtraceSettingsFile=TraceSettings.properties property to enable tracing of the ORB component for thin clients. ORB tracing output for thin clients can be directed by setting com.ibm.CORBA.Debug.Output = debugOutputFilename parameter in the command line.

The java.util.logging.manager and java.util.logging.configureByServer system properties configure Java logging to use a WAS-specific LogManager class and to use the configuration from the file specified by the traceSettingsFile property. The default Java Logging properties file, located in the Java SE Runtime Environment 6 (JRE6), will not be applied.

 

Configure the MyTraceSettings.properties file

Send trace output to a file using the traceFileName property.

Specify one of two options:

 

Specify a trace string for writing messages with the Trace String property

Specify a startup trace spec similar to that available on the server. For the convenience, we can 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:

 

Related tasks


Enable trace at server startup
Enable trace on a running server
Manage the appserver trace service

 

Related


Tracing and logging configuration