Previous Page | Next Page

The SAS Logging Facility

Formatting Messages

The format of a message can be customized by specifying a unique pattern layout for each appender class in the SAS logging facility. To create a pattern layout for an appender class, you use conversion characters that represent the types of data to include in the message. You can also control the sequence of the data and the alignment of the data in columns in the message.

Note:   The conversion patterns that are used in the SAS logging facility and in the C language PRINTF statement are similar.

In addition to the set of pattern layouts that are used by the appender classes in the SAS logging facility, a different set of pattern layouts is used by ARMAppender. For more information, see ARMAppender Pattern Layouts in SAS Interface to Application Response Measurement (ARM): Reference.  [cautionend]

Here is an excerpt of an XML file that contains a pattern layout:

<layout>
   <param name="ConversionPattern"  value="%d; %-5p; %t; %c; (%F:%L); %m"/>  
</layout> 

Each data item to be included in the message is represented by a conversion character. Also, literal text and alignment commands can be specified to enhance the message format. In this example, the data items are the date, the logging level, the thread, the logger, the log file, the line number in the calling program that specified the logging request, and the message.

Here is an example of a message :

2008-06-25-10:24:22,234; WARN; 3; Appender.IOMCallContext; (yn14.sas.c:149);  
           Numeric maximum was larger than 8, am setting to 8.

For more information, see Pattern Layout.

Previous Page | Next Page | Top of Page