- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.LayoutBase<E>
-
- ch.qos.logback.core.pattern.PatternLayoutBase<ILoggingEvent>
-
- ch.qos.logback.classic.PatternLayout
-
- All Implemented Interfaces:
Layout<ILoggingEvent>,ContextAware,LifeCycle
public class PatternLayout extends PatternLayoutBase<ILoggingEvent>
A flexible layout configurable with pattern string. The main method in this class is to
doLayout(ILoggingEvent). It returns the results as a {#link String}. The format and contents of the result depends on the conversion pattern.For more information about this layout, please refer to the online manual at layouts.html#PatternLayout
-
-
Field Summary
Fields Modifier and Type Field Description static Map<String,String>CONVERTER_CLASS_TO_KEY_MAPstatic Map<String,Supplier<DynamicConverter>>DEFAULT_CONVERTER_SUPPLIER_MAPstatic StringHEADER_PREFIX-
Fields inherited from class ch.qos.logback.core.pattern.PatternLayoutBase
outputPatternAsHeader, postCompileProcessor
-
Fields inherited from class ch.qos.logback.core.LayoutBase
started
-
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
-
Constructor Summary
Constructors Constructor Description PatternLayout()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringdoLayout(ILoggingEvent event)Transform an event (of type Object) and return it as a String after appropriate formatting.Map<String,Supplier<DynamicConverter>>getDefaultConverterSupplierMap()Concrete implementations of this class are responsible for elaborating the mapping between pattern words and supplying converter instances.protected StringgetPresentationHeaderPrefix()-
Methods inherited from class ch.qos.logback.core.pattern.PatternLayoutBase
getEffectiveConverterMap, getInstanceConverterMap, getPattern, getPresentationHeader, isOutputPatternAsHeader, setOutputPatternAsHeader, setPattern, setPostCompileProcessor, start, toString, writeLoopOnConverters
-
Methods inherited from class ch.qos.logback.core.LayoutBase
getContentType, getContext, getFileFooter, getFileHeader, getPresentationFooter, isStarted, setContext, setFileFooter, setFileHeader, setPresentationFooter, setPresentationHeader, stop
-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getDeclaredOrigin, getStatusManager
-
-
-
-
Field Detail
-
DEFAULT_CONVERTER_SUPPLIER_MAP
public static final Map<String,Supplier<DynamicConverter>> DEFAULT_CONVERTER_SUPPLIER_MAP
-
CONVERTER_CLASS_TO_KEY_MAP
public static final Map<String,String> CONVERTER_CLASS_TO_KEY_MAP
-
HEADER_PREFIX
public static final String HEADER_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PatternLayout
public PatternLayout()
-
-
Method Detail
-
getDefaultConverterSupplierMap
public Map<String,Supplier<DynamicConverter>> getDefaultConverterSupplierMap()
Description copied from class:PatternLayoutBaseConcrete implementations of this class are responsible for elaborating the mapping between pattern words and supplying converter instances.- Specified by:
getDefaultConverterSupplierMapin classPatternLayoutBase<ILoggingEvent>- Returns:
- A map associating pattern words to the names of converter suppliers
-
doLayout
public String doLayout(ILoggingEvent event)
Description copied from interface:LayoutTransform an event (of type Object) and return it as a String after appropriate formatting.Taking in an object and returning a String is the least sophisticated way of formatting events. However, it is remarkably CPU-effective.
- Parameters:
event- The event to format- Returns:
- the event formatted as a String
-
getPresentationHeaderPrefix
protected String getPresentationHeaderPrefix()
- Overrides:
getPresentationHeaderPrefixin classPatternLayoutBase<ILoggingEvent>
-
-