Package ch.qos.logback.classic.html
Class HTMLLayout
java.lang.Object
- All Implemented Interfaces:
Layout<ILoggingEvent>
,ContextAware
,LifeCycle
HTMLLayout outputs events in an HTML table.
The content of the table
columns are specified using a conversion pattern. See
PatternLayout
for documentation on the
available patterns.
For more information about this layout, please refer to the online manual at http://logback.qos.ch/manual/layouts.html#ClassicHTMLLayout
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String
Default pattern string for log output.(package private) IThrowableRenderer
<ILoggingEvent> Fields inherited from class ch.qos.logback.core.html.HTMLLayoutBase
counter, cssBuilder, head, pattern, 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 -
Method Summary
Modifier and TypeMethodDescriptionprivate void
appendEventToBuffer
(StringBuilder buf, Converter<ILoggingEvent> c, ILoggingEvent event) protected String
doLayout
(ILoggingEvent event) Transform an event (of type Object) and return it as a String after appropriate formatting.void
setThrowableRenderer
(IThrowableRenderer<ILoggingEvent> throwableRenderer) void
start()
Parses the pattern and creates the Converter linked list.Methods inherited from class ch.qos.logback.core.html.HTMLLayoutBase
getContentType, getCssBuilder, getEffectiveConverterMap, getFileFooter, getFileHeader, getPattern, getPresentationFooter, getPresentationHeader, getTitle, setCssBuilder, setPattern, setTitle, startNewTableIfLimitReached
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
-
Field Details
-
DEFAULT_CONVERSION_PATTERN
Default pattern string for log output.- See Also:
-
throwableRenderer
IThrowableRenderer<ILoggingEvent> throwableRenderer
-
-
Constructor Details
-
HTMLLayout
public HTMLLayout()Constructs a PatternLayout using the DEFAULT_LAYOUT_PATTERN. The default pattern just produces the application supplied message.
-
-
Method Details
-
start
public void start()Description copied from class:HTMLLayoutBase
Parses the pattern and creates the Converter linked list.- Specified by:
start
in interfaceLifeCycle
- Overrides:
start
in classHTMLLayoutBase<ILoggingEvent>
-
getDefaultConverterMap
- Specified by:
getDefaultConverterMap
in classHTMLLayoutBase<ILoggingEvent>
-
doLayout
Description copied from interface:Layout
Transform 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
-
appendEventToBuffer
private void appendEventToBuffer(StringBuilder buf, Converter<ILoggingEvent> c, ILoggingEvent event) -
getThrowableRenderer
-
setThrowableRenderer
-
computeConverterName
- Overrides:
computeConverterName
in classHTMLLayoutBase<ILoggingEvent>
-