|
Logback API Version 0.9.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.LayoutBase<E>
ch.qos.logback.core.pattern.PatternLayoutBase<LoggingEvent>
ch.qos.logback.classic.PatternLayout
public class PatternLayout
A flexible layout configurable with pattern string. The goal of this class is
to format
a LoggingEvent
and return the results in a
{#link String}. The format of the result depends on the
conversion pattern.
For more information about this layout, please refer to the online manual at http://logback.qos.ch/manual/layouts.html#PatternLayout
Field Summary | |
---|---|
static Map<String,String> |
defaultConverterMap
|
Fields inherited from class ch.qos.logback.core.LayoutBase |
---|
started |
Fields inherited from interface ch.qos.logback.core.Layout |
---|
LINE_SEP, LINE_SEP_LEN |
Constructor Summary | |
---|---|
PatternLayout()
|
Method Summary | |
---|---|
static boolean |
chainHandlesThrowable(Converter head)
This method computes whether a chain of converters handles exceptions or not. |
String |
doLayout(LoggingEvent event)
Transform an event (of type Object) and return it as a String after appropriate formatting. |
Map<String,String> |
getDefaultConverterMap()
Concrete implementations of this class are responsible for elaborating the mapping between pattern words and converters. |
protected void |
postCompileProcessing(Converter<LoggingEvent> head)
This implementation checks if any of the converters in the chain handles exceptions. |
Methods inherited from class ch.qos.logback.core.pattern.PatternLayoutBase |
---|
findTail, getEffectiveConverterMap, getInstanceConverterMap, getPattern, setContextForConverters, setPattern, start, toString, writeLoopOnConverters |
Methods inherited from class ch.qos.logback.core.LayoutBase |
---|
getContentType, getContext, getFileFooter, getFileHeader, getPresentationFooter, getPresentationHeader, isStarted, setContext, setFileFooter, setFileHeader, setPresentationFooter, setPresentationHeader, stop |
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase |
---|
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getStatusManager |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ch.qos.logback.core.spi.ContextAware |
---|
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn |
Field Detail |
---|
public static final Map<String,String> defaultConverterMap
Constructor Detail |
---|
public PatternLayout()
Method Detail |
---|
protected void postCompileProcessing(Converter<LoggingEvent> head)
This allows appenders using this layout to output exception information event if the user forgets to add %ex to the pattern. Note that the appenders defined in the Core package are not aware of exceptions nor LoggingEvents.
If for some reason the user wishes to NOT print exceptions, then she can add %nopex to the pattern.
postCompileProcessing
in class PatternLayoutBase<LoggingEvent>
public Map<String,String> getDefaultConverterMap()
PatternLayoutBase
getDefaultConverterMap
in class PatternLayoutBase<LoggingEvent>
public static boolean chainHandlesThrowable(Converter head)
head
- The first element of the chain
public String doLayout(LoggingEvent event)
Layout
Taking in an object and returning a String is the least sophisticated way of formatting events. However, it is remarkably CPU-effective.
event
- The event to format
|
Logback API Version 0.9.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |