Log4j Format Specification: Difference between revisions
Jump to navigation
Jump to search
Line 21: | Line 21: | ||
==Literal Text== | ==Literal Text== | ||
Literal text may include special characters (\t, \n \r \f). | Literal text may include special characters (\t, \n \r \f). '\\' can be used to insert a backslash in the output. | ||
==Conversion Specifier== | ==Conversion Specifier== |
Revision as of 17:46, 15 November 2017
External
Internal
Overview
log4j calls its output format layout. Most commonly used is the pattern layout.
Pattern Layout
The pattern layout is defined by a conversion pattern string, where various element of a log event can be referred and the way they are intended to be displayed in a log file specified. The conversion pattern is closely related to the conversion pattern of the printf function in C. The conversion pattern is composed of:
Literal Text
Literal text may include special characters (\t, \n \r \f). '\\' can be used to insert a backslash in the output.
Conversion Specifier
Format Modifier
A format modifier modifies how the data generated by the pattern layout element