Log Formatter

Description

The <formatter> element provides a mechanism to select a formatting type and optionally declare a custom format pattern.

Example 1

    <format type="console"/>

Example 2

    <format type="extended">
      %7.7{priority} %23.23{time:yyyy-MM-dd HH:mm:ss:SSS}   
      [%25.25{category}] : %{message}\n%{throwable}
    </format>

XML Specification

Attributes Description
type A keyword that identifies a format type (see Format Type Table). Format instances are constructed relative to to requested type and may take an element value as an argument. A formatter element value (if recognized by the format type) is a logkit format specification.

Format Type Table

Type Description Value
avalon Simple logging format with error reporting and stack trace listing enabled. yes
console Simple logging format with error reporting enabled and stack trace listing disabled. yes
extended Extended patttern formatter using a depth-offset of 1. yes
pattern Constructs a new pattern formatter. yes
xml Constructs an XML formatter. no
raw Constructs a formatter using the LogKit RawFormatter class. no
syslog Constructs a formatter using the LogKit SyslogFormatter class. no