|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.logging.log4j.core.layout.LayoutBase<String>
org.apache.logging.log4j.core.layout.AbstractStringLayout
org.apache.logging.log4j.core.layout.PatternLayout
public final class PatternLayout
A flexible layout configurable with pattern string. The goal of this class
is to format
a LogEvent
and return the results.
The format of the result depends on the conversion pattern.
The conversion pattern is closely related to the conversion pattern of the printf function in C. A conversion pattern is composed of literal text and format control expressions called conversion specifiers. See the Log4j Manual for details on the supported pattern converters.
Field Summary | |
---|---|
static String |
DEFAULT_CONVERSION_PATTERN
Default pattern string for log output. |
static String |
SIMPLE_CONVERSION_PATTERN
A simple pattern. |
static String |
TTCC_CONVERSION_PATTERN
A conversion pattern equivalent to the TTCCCLayout. |
Fields inherited from class org.apache.logging.log4j.core.layout.LayoutBase |
---|
footer, header, LOGGER |
Method Summary | |
---|---|
static PatternLayout |
createLayout(String pattern,
Configuration config,
RegexReplacement replace,
String charset)
Create a pattern layout. |
static PatternParser |
createPatternParser(Configuration config)
Create a PatternParser. |
String |
formatAs(LogEvent event)
Formats a logging event to a writer. |
void |
setConversionPattern(String conversionPattern)
Set the ConversionPattern option. |
String |
toString()
|
Methods inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout |
---|
format, getCharset |
Methods inherited from class org.apache.logging.log4j.core.layout.LayoutBase |
---|
getFooter, getHeader, setFooter, setHeader |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_CONVERSION_PATTERN
public static final String TTCC_CONVERSION_PATTERN
public static final String SIMPLE_CONVERSION_PATTERN
Method Detail |
---|
public void setConversionPattern(String conversionPattern)
conversionPattern
- conversion pattern.public String formatAs(LogEvent event)
event
- logging event to be formatted.
public static PatternParser createPatternParser(Configuration config)
config
- The Configuration.
public String toString()
toString
in class Object
public static PatternLayout createLayout(String pattern, Configuration config, RegexReplacement replace, String charset)
pattern
- The pattern. If not specified, defaults to DEFAULT_CONVERSION_PATTERN.config
- The Configuration. Some Converters require access to the Interpolator.replace
- A Regex replacement String.charset
- The character set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |