OSF DCE Application Development Guide--Core Components

OSF DCE Application Development Guide—Core Components
4.3.4 Howto Route Messages
Serviceability messages can be written to any of the normal output destinations. Routing
for serviceability messages can be specified in any of three different ways (in ascending
order of precedence):
1. By the contents of a routing file
2. By the contents of a routing environment variable
3. By calling the dce_svc_routing() routine (often as part of processing an
application’s command-line arguments)
Additional routing (that is, in addition to whatever routing has been specified by the
means described) of a message to standard error can be performed in either of the
following two ways:
By specifying the routing as one of the message’s attributes (in the sams file
definition of the message)
By specifying the attribute in the call to dce_svc_printf( ) (or other serviceability
output routine) to generate the message
Routing a message actually consists of specifying two things:
How the message should be processed (the form it should be put in)
Where the message should be sent (its destination)
The two specifications are sometimes closely interrelated, and sometimes specifying a
certain destination implies that the message must be put into a certain form. This fact
allows certain combinations of processing and destination to be abbreviated.
In the following sections, each of the ways to route serviceability messages is described.
Note that debug messages are routed by a similar, but slightly different, technique. For a
full description, see Section 4.3.12.
4.3.4.1 Using a Routing File
If a file called dce-local-path/svc/routing exists, the contents of the file (if in the proper
format) will be used to determine the routing of messages written via serviceability
routines.
The value of dce-local-path is usually /opt/dcelocal; the default location of the
serviceability routing file is usually /opt/dcelocal/svc/routing. However, a different
location for the file can be specified by setting the value of the environment variable
DCE_SVC_ROUTING_FILE to the complete desired pathname.
The contents of the routing file consists of formatted strings specifying the routing
desired for the various kinds of messages (based on message severity). Each string
consists of three fields as follows:
4 22 Tandem Computers Incorporated 124245