Trace Logging

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:

· Work process traces dev_w*

· Dispatcher trace dev_disp

· Gateway trace dev_rd

· ICM trace dev_icm

· Message server trace dev_ms

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):

· ALL: all trace files are searched (default)

· WP: all work process trace files are searched

· DISP: the dispatcher trace file is searched

· GWRD: the gateway trace file is searched

· ICMAN: the ICM trace file is searched (if available)

· MS: the message server trace file is searched (if available)

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_ is used to search the trace files for a specific pattern. The file is searched for the pattern, once the size specified in rdisp/TRACE_LOGGING has been exceeded. 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.


Note that wildcards reduce system performance, especially if they are in the middle of a pattern.

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.

Example

The pattern "word1 * word?" is found in the line "one example with word1 and word2", but not in the line "one example with word1 and word".

The pattern "10 \* 10 =" is found in the line "multiplication: 10 * 10 = 100", but not in the line "addition: 10 + 10 = 20".

Caution

You cannot join several search patterns logically, for example, you cannot search for pattern 1 and pattern 2.

System-Wide Trace Logging

If you want to search for a pattern on all the servers of a system and when this is found end the trace logging on all the servers (that is, reset the trace level to 1), you use the addition global=on. If global=off or is not set at all, the logging is only switched off on the server where the pattern was found.

Standalone Message Server.

The message server itself searches only for the string in dev_ms, if parameter ms/standalone = 1 is set. Otherwise the search is performed by a work process of the same instance as that with which the message server was started.

If the message server does the search itself, the search is started in a separate thread, which means that if the file is large, the normal processing of requests is not hindered.

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.

You can dynamically change this parameter in transaction RZ11.

The parameter values have the following syntax:

This graphic is explained in the accompanying text

rdisp/TRACE_LOGGING = on, [k | m] , [global=on | off] | 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. The addition global=on or global=off is effective only if the parameter rdisp/TRACE_PATTERN_0 for the pattern search has been set. (compare with system-wide trace logging).

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 contains more than 20 KB

· rdisp/TRACE_LOGGING = on, 30 m, global=on activates trace logging, if the trace file is larger than 30 megabytes. If the pattern searched for has been found in a trace file, trace logging is deactivated on all the servers.

2. 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:

· Work process traces dev_w*

· Dispatcher trace dev_disp

· Gateway trace dev_rd

· ICM trace dev_icm

· Message server trace dev_ms

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.

No comments:

topics