ConsoleAppender

Writes messages to the UNIX and Windows operating system consoles.
Valid in: XML configuration

Syntax

<appender class="ConsoleAppender" name="appender-name">
<layout>
<param name="ConversionPattern" value="conversion-pattern"/>
</layout>
</appender>

Syntax Description

<appender class=”ConsoleAppender” name=”appender-name”>
specifies the user-assigned name for this instance of ConsoleAppender.
Default None
Requirement The appender class and name are required to specify a console appender.
<param name=”ConversionPattern” value=”conversion-pattern”/>
specifies a series of conversion characters that represent the types of data to include in the log. For example, use the conversion characters %d %t %m to include the date, the thread, and the message, respectively, in the log.
See Pattern Layouts

Details

ConsoleAppender is a logging facility appender that supports event logging on UNIX and Windows operating systems. ConsoleAppender writes messages to the current console.

Example

The following example is a typical XML configuration file that specifies ConsoleAppender.
<?xml version="1.0" encoding="UTF-8"?>
<logging:configuration xmlns:logging="http://www.sas.com/xml/logging/1.0/">
   <appender class="ConsoleAppender" name="console">
      <layout>
         <param name=”ConversionPattern" value="%d %-5p [%t] %u - %m"/>
         </layout>
   <appender>
   <!-- Root logger -->
   <root>
      <level value="Error"/>
      <appender-ref ref="console"/>
   </root>
</logging:configuration>