Entering content frameFunction documentation Trace Logging Locate the document in its SAP Library structure

Use

You can use this function if you want to activate trace level 2 or 3 for a long period, but want to ensure that the trace file does not become too large. This is useful if you are trying to locate a sporadic error. If you are "waiting" for a particular trace output, you can specify that the trace file should be saved after the pattern you are searching for is found, and that the trace level should then be reset to 1.

In this way, you can easily control the size of the trace files. You can also search the trace file for a particular character string without running the risk of filling up your hard disk if a high trace level is active.

Features

Set Size Limit for Trace Files

To activate trace logging, you have to set the parameter rdisp/TRACE_LOGGING. Here, you also specify the maximum size of the trace file.

If the trace file reaches that size, the content is written to a log file with the name of the trace file and the extension .old. The current trace file is then reset. The parameter rdisp/autothtime is used to define how often the trace file should be checked and, if necessary, reset. The default is 60 seconds.

Trace logging is active for the following trace files:

Specify Trace Components

The parameter rdisp/TRACE_SEARCH_LIST is used to specify a list of trace components that you want taken into account in the automatic trace search.

As a value for this parameter, you can enter a list with the following elements (use a comma or a semicolon to separate elements):

Example

rdisp/TRACE_SEARCH_LIST = WP, ICMAN means: all work process trace files and the ICM trace file are searched.

Search Trace Files for a Pattern

The parameter rdisp/TRACE_PATTERN_<x> is used to search the trace files for a specific pattern. When the specified file size if exceeded, the file is then searched for this pattern. If the pattern is found, the trace level is reset to 1 for all active components.

You can also use wildcards (* for any character string, ? for a single character) in the pattern. Use the backslash (\) to ensure that special characters are treated as ordinary characters. See below for examples.

Example

For the sake of readability, the search patterns in the following examples are enclosed in inverted commas. When specifying your own search terms in RZ11 or in the profiles, however, enter them without inverted commas.

Activities

Proceed as follows.

  1. Activate trace logging by setting the parameter rdisp/TRACE_LOGGING to ON. Also specify the size at which, once reached, the trace file is logged and the trace level is reset to 1.
  2. You can dynamically change this parameter in transaction RZ11.

    The parameter values have the following syntax:

    Syntax 

    rdisp/TRACE_LOGGING = on, <n> [k m] off

    The first part specifies that logging is active. The value here can be either ON or OFF. If logging is active, you can specify the file size in the second part.

    Example

    rdisp/TRACE_LOGGING = off : no trace logging

    rdisp/TRACE_LOGGING = on, 1000: trace is logged if the trace file contains more than 1000 bytes

    rdisp/TRACE_LOGGING = on, 20 k: trace is logged if the trace file conatins more than 20 KB

    rdisp/TRACE_LOGGING = on, 30 m: trace is logged if the trace file is greater than 30 MB

  3. Use the parameter rdisp/TRACE_PATTERN_0 to specify a trace pattern for automatically switching off the SAP trace. This parameter has effect only if trace logging is activated using rdisp/TRACE_LOGGING. In this case, the trace files are searched for the search pattern before being automatically reset. If the pattern is found, trace logging is deactivated and the trace level is reset to 1. The following trace files are included in the search:

The search pattern can contain the special character * for any character string, and ? for any character. The parameters rdisp/TRACE_PATTERN_1 and rdisp/TRACE_PATTERN_2 can be used to define other search patterns. All search patterns use the or operator; in other words, if one of the patterns is found, the trace level is reset.

Example

Click here for an example of trace logging in use.

 

 

Leaving content frame