InfoCenter Home >
4: Developing applications >
4.7: Java Clients >
4.7.7: Tracing and logging for the Java clients
4.7.7: Tracing and logging for the Java clients
Tracing and logging functions are available for the WebSphere client runtime.
How this support is enabled and the level of support provided, differs for each client model.
J2EE Application Client
You enable the tracing and logging functions by specifying one of the following flags on the
launchClient command when
starting the J2EE client application:
CCtrace flag
The -CCtrace flag enables trace. You can trace all or specific components:
- -CCtrace=true
(This flag enables trace for all components and all events.)
- -CCtrace=com.ibm.<component>=<entryexit | debug | event | all>=enabled
(This flag enables trace for specific components. For example,
-CCtrace=com.ibm.ws.client.*=all=enabled enables trace for all loggers with names starting with com.ibm.ws.client.)
If the -CCtrace flag is not specified, trace is disabled.
CCtracefile flag
Use the -CCtracefile flag to send the trace output to a specific file:
-CCtracefile=<fully_qualified_output_filename>
(For example,
-CCtracefile=c:\MyTraceFile.log
directs the trace output to file, c:\MyTraceFile.log.)
If the -CCtracefile flag is not set,
all output is directed to stdout.
Java thin application client
You enable the tracing and logging functions by specifying the following system
property on the java command when starting the client application:
-DtraceSettingsFile=<filename>
(Filename is the name of a properties file that
must be placed in the classpath accessible by the application.)
The properties file is used for specifying the output file and the components to enable for trace.
When you install WebSphere Application Server, a sample trace settings properties file is provided in:
<product_installation>/properties/TraceSettings.properties
The TraceSettings.properties file looks like the following example:
# property to specify the fully qualified file name for the tracefile
traceFileName=c:\\MyTraceFile.log
# Specify trace strings here. Trace strings take the form of:
# logger={level}={type} where:
# level = entryexit || debug || event || all
# type = enabled || disabled
# examples:
# com.ibm.ejs.ras.SharedLogBase=all=enabled enables all tracing for the single logger
# created in class com.ibm.ejs.ras.SharedLogBase.
# com.ibm.ejs.*=debug=enabled enables debug tracing for all loggers with names starting
# with com.ibm.ejs.
#
# Multiple trace strings can be specified, one per line.
com.ibm.ejs.ras.*=all=enabled
|
If you specify a filename but no trace string,
only message events are written to the specified file. If you specify a filename
and a trace string, both message events and diagnostic trace entries are written
to the specified file. If you do not specify a filename for the trace file,
all output is directed to stdout.
|
|