Package ch.qos.logback.core.html
Class HTMLLayoutBase<E>
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.LayoutBase<E>
-
- ch.qos.logback.core.html.HTMLLayoutBase<E>
-
- All Implemented Interfaces:
Layout<E>
,ContextAware
,LifeCycle
- Direct Known Subclasses:
HTMLLayout
,HTMLLayout
public abstract class HTMLLayoutBase<E> extends LayoutBase<E>
This class is a base class for HTMLLayout classes part of other logback modules such as logback-classic and logback-access.- Author:
- Sébastien Pennec
-
-
Field Summary
Fields Modifier and Type Field Description protected long
counter
protected CssBuilder
cssBuilder
protected Converter<E>
head
protected java.lang.String
pattern
protected java.lang.String
title
-
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 HTMLLayoutBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
computeConverterName(Converter c)
java.lang.String
getContentType()
Returns the content type output by this layout, i.e "text/html".CssBuilder
getCssBuilder()
protected abstract java.util.Map<java.lang.String,java.lang.String>
getDefaultConverterMap()
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.lang.String
getFileFooter()
Returns the appropriate HTML footers.java.lang.String
getFileHeader()
Returns appropriate HTML headers.java.lang.String
getPattern()
Returns the value of the ConversionPattern option.java.lang.String
getPresentationFooter()
Return the footer of the logging event formatting.java.lang.String
getPresentationHeader()
Return the header of the logging event formatting.java.lang.String
getTitle()
Returns the current value of the Title option.void
setCssBuilder(CssBuilder cssBuilder)
void
setPattern(java.lang.String conversionPattern)
Set the ConversionPattern option.void
setTitle(java.lang.String title)
The Title option takes a String value.void
start()
Parses the pattern and creates the Converter linked list.protected void
startNewTableIfLimitReached(java.lang.StringBuilder sbuf)
-
Methods inherited from class ch.qos.logback.core.LayoutBase
getContext, 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, toString, wait, wait, wait
-
-
-
-
Field Detail
-
pattern
protected java.lang.String pattern
-
title
protected java.lang.String title
-
cssBuilder
protected CssBuilder cssBuilder
-
counter
protected long counter
-
-
Method Detail
-
setPattern
public void setPattern(java.lang.String conversionPattern)
Set the ConversionPattern option. This is the string which controls formatting and consists of a mix of literal content and conversion specifiers.
-
getPattern
public java.lang.String getPattern()
Returns the value of the ConversionPattern option.
-
getCssBuilder
public CssBuilder getCssBuilder()
-
setCssBuilder
public void setCssBuilder(CssBuilder cssBuilder)
-
start
public void start()
Parses the pattern and creates the Converter linked list.- Specified by:
start
in interfaceLifeCycle
- Overrides:
start
in classLayoutBase<E>
-
getDefaultConverterMap
protected abstract java.util.Map<java.lang.String,java.lang.String> getDefaultConverterMap()
-
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.
-
setTitle
public void setTitle(java.lang.String title)
The Title option takes a String value. This option sets the document title of the generated HTML document.Defaults to 'Logback Log Messages'.
-
getTitle
public java.lang.String getTitle()
Returns the current value of the Title option.
-
getContentType
public java.lang.String getContentType()
Returns the content type output by this layout, i.e "text/html".- Specified by:
getContentType
in interfaceLayout<E>
- Overrides:
getContentType
in classLayoutBase<E>
- Returns:
-
getFileHeader
public java.lang.String getFileHeader()
Returns appropriate HTML headers.- Specified by:
getFileHeader
in interfaceLayout<E>
- Overrides:
getFileHeader
in classLayoutBase<E>
- Returns:
- The header.
-
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.
-
getPresentationFooter
public java.lang.String getPresentationFooter()
Description copied from interface:Layout
Return the footer of the logging event formatting. The returned value may be null.- Specified by:
getPresentationFooter
in interfaceLayout<E>
- Overrides:
getPresentationFooter
in classLayoutBase<E>
- Returns:
- The footer.
-
getFileFooter
public java.lang.String getFileFooter()
Returns the appropriate HTML footers.- Specified by:
getFileFooter
in interfaceLayout<E>
- Overrides:
getFileFooter
in classLayoutBase<E>
- Returns:
- The footer.
-
startNewTableIfLimitReached
protected void startNewTableIfLimitReached(java.lang.StringBuilder sbuf)
-
computeConverterName
protected java.lang.String computeConverterName(Converter c)
-
-