public class PatternLayout extends Layout
Modifier and Type | Field and Description |
---|---|
protected int |
BUF_SIZE |
static String |
DEFAULT_CONVERSION_PATTERN
Default pattern string for log output.
|
protected int |
MAX_CAPACITY |
static String |
TTCC_CONVERSION_PATTERN
A conversion pattern equivalent to the TTCCCLayout.
|
LINE_SEP, LINE_SEP_LEN
Constructor and Description |
---|
PatternLayout()
Constructs a PatternLayout using the DEFAULT_LAYOUT_PATTERN.
|
PatternLayout(String pattern)
Constructs a PatternLayout using the supplied conversion pattern.
|
Modifier and Type | Method and Description |
---|---|
void |
activateOptions()
Does not do anything as options become effective
|
protected PatternParser |
createPatternParser(String pattern)
Returns PatternParser used to parse the conversion string.
|
String |
format(LoggingEvent event)
Produces a formatted string as specified by the conversion pattern.
|
String |
getConversionPattern()
Returns the value of the ConversionPattern option.
|
boolean |
ignoresThrowable()
The PatternLayout does not handle the throwable contained within
LoggingEvents . |
void |
setConversionPattern(String conversionPattern)
Set the ConversionPattern option.
|
getContentType, getFooter, getHeader
public static final String DEFAULT_CONVERSION_PATTERN
public static final String TTCC_CONVERSION_PATTERN
protected final int BUF_SIZE
protected final int MAX_CAPACITY
public PatternLayout()
public PatternLayout(String pattern)
public void activateOptions()
protected PatternParser createPatternParser(String pattern)
public String format(LoggingEvent event)
public String getConversionPattern()
public boolean ignoresThrowable()
LoggingEvents
. Thus, it returns
true
.ignoresThrowable
in class Layout
public void setConversionPattern(String conversionPattern)
Copyright © 1999-2022 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.