Use the binary trace facility

Intelligent Management provides a binary trace facility (BTF) that permits the gathering of trace information in a production environment with a minimal impact on performance. The BTF is useful for both customers and development teams because its efficiency facilitates leaving a basic level of trace on all the time; thus, it is frequently the case that the data necessary for troubleshooting a problem has been captured the first time it occurs.

The binary trace facility (BTF) is rule-based, and deeper tracing can be enabled based on conditions detected at runtime. The BTF can:

Avoid trouble: Do not modify the trace-cfg.xml file syntax. Instead, use of the cell custom properties to control the BTF. The trace-cfg.xml contains the initial trace enablement settings used by the trace facility. After being loaded, trace-cfg.xml is not loaded again by the JVM. gotcha

Avoid trouble: If we restart the server all btrace files will disappear and get regenerated from scratch.gotcha

The trace command has two main parameters:

The "read" parameter:

Reads the BTF file and displays it.

The "info" parameter:

Displays information about what types of information are going to be printed.

For more information, read about binary trace facility custom properties.

  1. To translate the binary trace files that are produced by the BTF into a human readable form. Run the following command from the app_server_root/bin/trace directory:

      app_server_root/bin/trace read <logDirectory> [<traceSpec>]

    <logDirectory>

    Path to a server log directory.

    <traceSpec>

    Trace specification, which is a comma-separated list of elements of the form <groupOrRecord>[<:traceLevel>], where groupOrRecord specifies the name of a group or record, and traceLevel identifies the level of debug desired, as defined by the group or record.

    -filePrefix

    Indicates that a non-default trace file prefix name is being supplied.

    <prefix>

    Trace file prefix name. The default value is btrace

    For example, to read the btrace files in the current directory for all records, run the following command,

      app_server_root/bin/trace read .

    To see all btrace in the http group in the logs from the current directory, down to level 2 trace, run the following:

      app_server_root/bin/trace read . http:2

  2. To get a description of everything that can be traced, run the following command:

      app_server_root/bin/trace info [<groupOrRecordOrFieldName>] [-depth <maxDepth>]

    <groupOrRecordOrFieldName>

    Name of a group, record, or field for which information is needed.

    -depth

    Indicates that a maximum depth is being supplied.

    <maxDepth>

    The depth specified will include all groups, records, and fields that are within the specified depth from the initial argument provided.

    Use the field descriptors to limit the output, and -depth to further refine that by limiting how deep into the hierarchy the filter should go. If we do not specify a maximum depth, all of the information is displayed.

    For example, for information on the http.request group, but no deeper, run the following command:

      app_server_root/bin/trace info http.request -depth 1


Subtopics

  • Intelligent Management: binary trace facility custom properties