Installation guide

Sms4Domino Help
- 111 -
Conversion Pattern
Conversion PatternConversion Pattern
Conversion Pattern
The conversion pattern specifies what information must be logged for an event. Example
log4
j
.appender.console1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %m %n
The conversion pattern is written to the right of the = sign. It is composed of literal text and conversion
specifiers. Conversion specifiers start with the % character followed by optional format modifiers and
a conversion character. The conversion character specifies the type of data, e.g. category, priority,
date, thread name. The format modifiers control such things as field width, padding, left and right
justification
. The following is a simple example copied from the log4
j Javadoc
(
http://logging.apache.org/log4
j
/1.2/apidocs/org/apache/log4
j
/PatternLayout.html)
Let the conversion pattern be "%-5p [%t]: %m%n" and assume that the log4
j environment was set to
use a PatternLayout. When logging the messages "Message 1" and "Message 2" would yield the
output
DEBUG [main]: Message 1
WARN [main]: Message 2
Some conversion characters
Some conversion charactersSome conversion characters
Some conversion characters
%c: name of the logger
%d: date of the logging event. It may be followed by a date format written between { }. E. g.
%d{HH:mm:ss,SSS} or %d{dd MMM yyyy HH:mm:ss,SSS}. If no date format specifier is given
then ISO8601 format is assumed.
%m: the application supplied message associated with the logging event.
%n: the platform dependent line separator character or characters
%t: name of the thread
%%: the sequence %% outputs a single percent sign.