Package ch.qos.logback.core.pattern
Class PatternLayoutBase<E>
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.LayoutBase<E>
-
- ch.qos.logback.core.pattern.PatternLayoutBase<E>
-
- All Implemented Interfaces:
Layout<E>
,ContextAware
,LifeCycle
- Direct Known Subclasses:
PatternLayout
,PatternLayout
public abstract class PatternLayoutBase<E> extends LayoutBase<E>
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
outputPatternAsHeader
protected PostCompileProcessor<E>
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 PatternLayoutBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract java.util.Map<java.lang.String,java.lang.String>
getDefaultConverterMap()
Concrete implementations of this class are responsible for elaborating the mapping between pattern words and converters.java.util.Map<java.lang.String,java.lang.String>
getEffectiveConverterMap()
Returns a map where the default converter map is merged with the map contained in the context.java.util.Map<java.lang.String,java.lang.String>
getInstanceConverterMap()
java.lang.String
getPattern()
java.lang.String
getPresentationHeader()
Return the header of the logging event formatting.protected java.lang.String
getPresentationHeaderPrefix()
boolean
isOutputPatternAsHeader()
protected void
setContextForConverters(Converter<E> head)
void
setOutputPatternAsHeader(boolean outputPatternAsHeader)
void
setPattern(java.lang.String pattern)
void
setPostCompileProcessor(PostCompileProcessor<E> postCompileProcessor)
void
start()
java.lang.String
toString()
protected java.lang.String
writeLoopOnConverters(E event)
-
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
postCompileProcessor
protected PostCompileProcessor<E> postCompileProcessor
-
outputPatternAsHeader
protected boolean outputPatternAsHeader
-
-
Method Detail
-
getDefaultConverterMap
public abstract java.util.Map<java.lang.String,java.lang.String> getDefaultConverterMap()
Concrete implementations of this class are responsible for elaborating the mapping between pattern words and converters.- Returns:
- A map associating pattern words to the names of converter classes
-
getEffectiveConverterMap
public java.util.Map<java.lang.String,java.lang.String> getEffectiveConverterMap()
Returns a map where the default converter map is merged with the map contained in the context.
-
start
public void start()
- Specified by:
start
in interfaceLifeCycle
- Overrides:
start
in classLayoutBase<E>
-
setPostCompileProcessor
public void setPostCompileProcessor(PostCompileProcessor<E> postCompileProcessor)
-
setContextForConverters
protected void setContextForConverters(Converter<E> head)
Deprecated.UseConverterUtil.setContextForConverters(ch.qos.logback.core.Context, ch.qos.logback.core.pattern.Converter<E>)
instead. This method will be removed in future releases.- Parameters:
head
-
-
writeLoopOnConverters
protected java.lang.String writeLoopOnConverters(E event)
-
getPattern
public java.lang.String getPattern()
-
setPattern
public void setPattern(java.lang.String pattern)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getInstanceConverterMap
public java.util.Map<java.lang.String,java.lang.String> getInstanceConverterMap()
-
getPresentationHeaderPrefix
protected java.lang.String getPresentationHeaderPrefix()
-
isOutputPatternAsHeader
public boolean isOutputPatternAsHeader()
-
setOutputPatternAsHeader
public void setOutputPatternAsHeader(boolean outputPatternAsHeader)
-
getPresentationHeader
public java.lang.String getPresentationHeader()
Description copied from interface:Layout
Return the header of the logging event formatting. The returned value may be null.- Specified by:
getPresentationHeader
in interfaceLayout<E>
- Overrides:
getPresentationHeader
in classLayoutBase<E>
- Returns:
- The header.
-
-