PreviousNext

Routing Debug Messages

Routing for serviceability debug messages can be specified in any of four ways:

· By calling the dce_svc_debug_routing( ) routine

· By the contents of the SVC_CMP_DBG environment variable (where CMP is the three-character serviceability name of the component, in uppercase)

· By the contents of the routing file dce-local-path/svc/routing

· By one of the message's attributes (as coded in the sams file)

In all but the last method, the routing is specified by the contents of a specially formatted string that is either included in the value of the environment variable, is part of the contents of the routing file, or is passed to the dce_svc_debug_routing( ) routine.

The general format for the debug routing specifier string is

component:sub_comp.level,...:out_form:dest [out_form:dest ...] [GOESTO:{sev | comp}]

where:

component
Specifies the component name.

sub_comp.level
Specifies a subcomponent name, followed (after a dot) by a debug level (expressed as a single digit from 1 to 9). Note that multiple subcomponent/level pairs can be specified in the string.

The meanings of the remaining elements of the string are the same as those for the identically named elements in How to Route Messages.

Multiple routings for the same group of subcomponents can be specified by adding semicolon-separated strings of the following format:

out_form:dest

to the specification, in a form analogous to that followed for specifying production (nondebug) message routes, shown previously.

The following string would, when passed to dce_svc_debug_routing( ), set the debug level and routing for all hel subcomponents:

unsigned_char_t *debug_routes = \
"hel:*.4:TEXTFILE:/tmp/hel_debug_log_%ld;STDERR:-";

A debug level of svc_c_debug4 is specified, and all debug messages of that level or lower will be written both to standard error and in text form to the following file:

/tmp/hel_debug_log_process_ID

where process_ID is the process ID of the program writing the messages.

The specification string could be passed to dce_svc_debug_routing( ) as follows:

dce_svc_debug_routing(debug_routes, &status);

To specify the same routing by environment variable, the string following value should be assigned to SVC_CMP_DBG:

hel:*.4:TEXTFILE:/tmp/hel_debug_log_%ld;STDERR:-

The same string information could also be inserted into the SVC_CMP environment variable or into the contents of the routing file.

Debug routing by attribute (as specified in the sams file) is done in the same way as routing for normal messages. See Additional Routing by Attribute.