WebSphere® Virtual Enterprise provides
a binary trace facility (BTF) that, by default, gathers trace information
in a production environment that is useful for customers and development
teams, because the level of trace gathered facilitates troubleshooting
problems without having to reproduce the problem. Further, optimal
performance in your environment is not compromised.
About this task
The primary advantage of using the BTF is to provide an efficient
means, with respect to CPU and disk space, of gathering trace information
in a production environment that is usable and understandable to customers,
support, or development teams. With a more efficient trace facility,
the level of trace gathered by default facilitates troubleshooting
problems without having to reproduce the problem or affecting good
performance in your environment. Three ways to use the BTF are described
as follows:
- Use the trace data that is generated by default.
- Modify trace dynamically by setting a cell custom property. See Binary trace facility custom properties.
- Modify the WAS_install/etc/trace-cfg.xml file.
All BTF tracing is performed in the log directory of each server.
By default, the files are currently named btrace.#, where # is a monotonically
increasing integer starting at 1. You can edit and copy this file
to the profile_root/config/cells/cell_name directory
or to the same directory that contains the server.xml file
for the process.
Note: Modifying the trace-cfg.xml file
is not recommended. It is not a dynamic file, is a more technical
method, and could break during future migrations.
Procedure
- To get a complete usage description of the trace command,
run the following command from the install_root/bin/trace directory.
The following is a sample output:
myServer:/opt/WAS611/bin #./trace
Usage error: too few arguments
Options:
To read binary trace:
read <logDirectory> [<traceSpec>] [-filePrefix <prefix>]
To get information about trace groups, records, and fields:
info [<groupOrRecordOrFieldName>] [-depth <maxDepth>]
where:
<logDirectory> is the path to a server log directory
<traceSpec> is trace specification, which is a comma-separated list of elements of the form:
<groupOrRecord>[:<traceLevel>]
<prefix> is the trace file prefix name (default value is 'btrace.')
<groupOrRecordOrFieldName> is the name of a group, record, or field for which information is needed
<maxDepth> is the maximum depth to recurse when printing group, record, or field information.
xdblade01b02:/opt/WAS611/bin #
- To get an XML description of everything that can be traced,
run the following command:
install_root/bin/trace info
- To control the amount of information printed, use the -depth <maxDepth>
option. To control the type of information that is printed, add an
additional argument specifying the name of a group, record, or field. For example, to see everything immediately below the HTTP group,
type the following:
install_root/bin/trace info http.request -depth 1