Package org.apache.log4j
Class PatternLayout
java.lang.Object
org.apache.log4j.Layout
org.apache.log4j.PatternLayout
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intstatic final StringDefault pattern string for log output.protected final intstatic final StringA conversion pattern equivalent to the TTCCCLayout.Fields inherited from class org.apache.log4j.Layout
LINE_SEP, LINE_SEP_LEN -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a PatternLayout using the DEFAULT_LAYOUT_PATTERN.PatternLayout(String pattern) Constructs a PatternLayout using the supplied conversion pattern. -
Method Summary
Modifier and TypeMethodDescriptionvoidDoes not do anything as options become effectiveprotected PatternParsercreatePatternParser(String pattern) Returns PatternParser used to parse the conversion string.format(LoggingEvent event) Produces a formatted string as specified by the conversion pattern.Returns the value of the ConversionPattern option.booleanThe PatternLayout does not handle the throwable contained withinLoggingEvents.voidsetConversionPattern(String conversionPattern) Set the ConversionPattern option.Methods inherited from class org.apache.log4j.Layout
getContentType, getFooter, getHeader
-
Field Details
-
DEFAULT_CONVERSION_PATTERN
Default pattern string for log output. Currently set to the string "%m%n" which just prints the application supplied message.- See Also:
-
TTCC_CONVERSION_PATTERN
A conversion pattern equivalent to the TTCCCLayout. Current value is "%r [%t] %p %c %x - %m%n"- See Also:
-
BUF_SIZE
protected final int BUF_SIZE- See Also:
-
MAX_CAPACITY
protected final int MAX_CAPACITY- See Also:
-
-
Constructor Details
-
PatternLayout
public PatternLayout()Constructs a PatternLayout using the DEFAULT_LAYOUT_PATTERN. The default pattern just produces the application supplied message. -
PatternLayout
Constructs a PatternLayout using the supplied conversion pattern.
-
-
Method Details
-
activateOptions
public void activateOptions()Does not do anything as options become effective -
createPatternParser
Returns PatternParser used to parse the conversion string. Subclasses may override this to return a subclass of PatternParser which recognize custom conversion characters.- Since:
- 0.9.0
-
format
Produces a formatted string as specified by the conversion pattern. -
getConversionPattern
Returns the value of the ConversionPattern option. -
ignoresThrowable
public boolean ignoresThrowable()The PatternLayout does not handle the throwable contained withinLoggingEvents. Thus, it returnstrue.- Specified by:
ignoresThrowablein classLayout- Returns:
- true if the Layout ignores Throwables.
- Since:
- 0.8.4
-
setConversionPattern
Set the ConversionPattern option. This is the string which controls formatting and consists of a mix of literal content and conversion specifiers.
-