Table of Contents


Emergency Tracing

This script manages emergency tracing. Emergency tracing is controlled by a file in the FIG temporary directory containing trace information. It enables developers to turn on tracing without the cumbersome requirement for adding parameters to the URL. This method does not do the tracing, it merely sets up data structures that allow tracing to take place without explicit authorization from form or command-line parameters.

This script supports the following CGI query parameters.

Trace

Trace level and list of trace modules to turn on, space-delimited. The default is no tracing.

Level

Level at which to turn on emergency tracing, generally a number from 0 through 4.

Packages[]

A list of trace packages to activate. This parameter can be multiply-occurring, or you can pass in a set of package names separated by spaces.

TType

Type of tracing to use: WARN to trace to the server error log, QUEUE to queue output to the web page, FILE to write to a temporary file, or APPEND to append to a temporary file.

Hours

Number of hours to leave emergency tracing active. Note that for web services, tracing will turn off automatically at the end of the web session when the cookie is erased.

Activate

If specified, emergency tracing is turned on and any existing trace file will be deleted.

Terminate

If specified, emergency tracing is turned off.

ShowFile

If specified, the trace file is displayed in the output.

CloseLine

my $html = CloseLine($traceMode);

Close off the current output line for the trace file display.

traceMode

1 if we are processing trace lines, 0 if we are processing text lines, 2 if we are between rows of the table.

RETURN

Returns the HTML for closing off the current line.

ProcessLine

my $newTraceMode = ProcessLine($line, $traceMode);

Process and display a line from the trace file.

line

The line to display. This may be either a trace line, with date, module name, and message, or a data line, with just plain data.

traceMode

The current display mode: 0 is line mode, meaning we have been writing data lines. 1 is trace mode, meaning we have been writing trace lines. 2 is start mode, meaning we are between rows. The importance here is that the display mode tells us what we did with the previous line, and determine how we will separate the new line from the old one. A trace line represents a table row, while a data line is part of the previous trace line's message. See also CloseLine.

RETURN

Returns 0 if the incoming line was a data line and 1 if it was a trace line. This value should be used as the traceMode value for the next call.