SAS/CONNECT: Definitions and Services |
About the SAS Logging Facility |
The SAS/CONNECT server and the SAS/CONNECT spawner use the SAS logging facility as the standard debugging tool in a SAS Foundation environment and in a SAS Intelligence Platform deployment. To make the logging facility functional, you must configure its properties in a logging configuration file. After you configure the file, you can easily enable the logging facility by specifying the -LOGCONFIGLOC system option in the SAS invocation.
Here are the primary components that are defined in the configuration file:
specify the objects that are used to create log events for a specific aspect of an application. A predefined set of loggers corresponds to the supported components such as Root, Audit, Admin, App, IOM, and Perf.
specify the output destinations for the log events. Examples include the FileAppender, RollingFileAppender, DBAppender, and ARMAppender. A level of severity is also associated with the log event. Examples are trace, debug, info, warn, error, and fatal.
specify the formats of the error messages that are associated with the log event.
For complete details about the component of the SAS logging facility, see SAS Logging: Configuration and Programming Reference.
Logging Configuration File |
Here is a typical configuration file that defines the logging components:
Typical Log Configuration File for SAS/CONNECT <?xml version="1.0" ?> <log4sas:configuration xmlns:log4sas="http://www.sas.com/rnd/Log4SAS/" debug="true"> 1 <appender name="LOG" class="FileAppender" > 2 <param name="File" value="c:\v9\spawner.log" /> <layout> <param name="ConversionPattern" value="%d %-5p [%t] %c (%F:%L) - %m" /> 3 </layout> <param name="threshold" value="all" /> </appender> <root> 4 <appender-ref ref="LOG" /> <level value="all" /> </root> </log4sas:configuration>
DEBUG="TRUE" indicates that debugging is enabled.
CLASS="FileAppender" indicates that the log events are written to the file path c:\v9\spawner.log.
The ConversionPattern parameter specifies a pattern layout that formats log messages. It identifies the type of data, the order of the data, and the format of the data that is generated in a log event and is delivered as output. In this example, the date and time, the log level, the thread ID, and the logger constitute the log event.
The root logger controls the entire SAS log event and is at the highest level in the logger hierarchy. If any other loggers are included in the logging configuration file, they are located beneath the ROOT logger in the hierarchy. All other loggers inherit the specified appender and threshold value of the root logger.
Invocation of the Logging Facility |
The SAS logging facility is started in a SAS invocation. Here is a Windows example:
sas -logconfigloc winlog.xml
The -LOGCONFIGLOC option is used to specify the location of the logging configuration file named winlog.xml, which is used to initialize the SAS logging facility. The file specification that defines the location of the logging configuration file must be a valid filename or a path and filename for your operating environment.
Triggers for Log Events |
Log events are triggered for SAS/CONNECT under these circumstances:
server sign-on via the SIGNON statement and the SAS/CONNECT spawner invocation
the beginning of the RSUBMIT statement and the occurrence of the ENDRSUBMIT statement
server sign-off via the SIGNOFF statement and the SAS/CONNECT spawner termination
Note: SAS/CONNECT sign-on to and sign-off from a grid session is also supported. For details, see Grid Computing in SAS.
Performance (such as response time, throughput, and availability) can also be measured for SAS transactions such as a DATA step or a SAS procedure in a SAS/CONNECT application by using the product SAS Application Response Measurement (ARM). To enable ARM, you would insert ARM macros into the SAS/CONNECT application. For details about implementing ARM in a SAS/CONNECT application, see SAS Interface to Application Response Measurement (ARM): Reference and SAS Logging: Configuration and Programming Reference.Example of a Log Event |
The data and the format of the log event are defined in the conversion pattern that is specified in the configuration file. Here is an example of a log event:
2008-06-25-10:24:22,234; WARN; 3; Appender.File; (yn14.sas.c:149); Numeric maximum was larger than 8, am setting to 8.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.