Previous Page | Next Page

Overview of the Logging Configuration File

Structure of the Logging Configuration File

The layout of a logging facility XML configuration file must contain, at minimum, the <?xml?> element, the <logging> element, and a <root> logger. When you add appenders and loggers, the elements must appear in this order:

See XML Elements for Configuring SAS Logging for information about the number of instances for each element.

Here is an example configuration file that shows the structure of the configuration file:

<?xml  version="1.0" encoding="UTF-8"?>
   <logging:configuration xmlns:logging="http//support.sas.com/xml/logging/1.0/">
      <appender class="RollingFileAppender" name="TimeBasedRollingFile">
         <param name="Append" value="true"/>
         <param name="ImmediateFlush" value="true"/>
         <param name="Unique" value="true"/>
         <filter class="StringMatchFilter">
            <param name="LevelToMatch" value="error"/>
            <param name="AcceptOnMatch" value="true"/>
         </filter >
         <rollingPolicy class="TimeBasedRollingPolicy">
            <param name="FileNamePattern" value="c:\sas\logs\server\workspace_%d.log"/>
         </rollingPolicy>
         <layout>
            <param name="ConversionPattern" value="%d %-5p [%t] %u - %m"/>
         </layout>
      </appender>
      <appender class="FileAppender" name="rootAppender">
         <param name="Append" value="true"/>
         <param name="ImmediateFlush" value="true"/>
         <param name="File" value="c:\logs\root\root1.log"/>
      </appender>
      <logger name="log4WServer">
         <level value="info"/>
         <appender-ref ref="TimeBasedRollingFile"/>
      </logger> 
      <root>
          <level value="error">
          <appender-ref ref="rootAppender"/>
      </root>
   </logging:configuration>

Previous Page | Next Page | Top of Page