WebSphere Application Server - Express, Version 6.0.x     Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Enabling trace on client and standalone applications

Why and when to perform this task

When standalone client applications (such as Java applications which access enterprise beans hosted in WebSphere Application Server) have problems interacting with WebSphere Application Server, 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 application server and client applications, and match records according to timestamp to try to understand where a problem is occurring.

Steps for this task

  1. To enable trace for the WebSphere Application Server 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 WebSphere Application Servers. For example, trace the standalone client application program named com.ibm.sample.MyClientProgram, you would enter the following command:
    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 filename must be a properties file placed in the classpath of the application client or stand-alone process. An example file is provided in install_root/properties/TraceSettings.properties.

    You 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 WebSphere Application Server-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 Runtime Environment (JRE), will not be applied.

  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.

Result

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.



Task topic    

Terms of Use | Feedback

Last updated: Jun 8, 2005 12:45:23 PM EDT
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/ttrb_entrstandal.html

© Copyright IBM Corporation 2004, 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)