Top Description Fields Constructors Methods
ch.qos.logback.classic.layout

public Class TTLLLayout

extends LayoutBase<ILoggingEvent>
Class Inheritance
Imports
ch.qos.logback.classic.pattern.ThrowableProxyConverter, ch.qos.logback.classic.spi.ILoggingEvent, .IThrowableProxy, ch.qos.logback.core.CoreConstants, .LayoutBase, ch.qos.logback.core.util.CachingDateFormatter, org.slf4j.event.KeyValuePair, java.util.List

A layout with a fixed format. The output is equivalent to that produced by PatternLayout with the pattern:

%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%kvp- %msg%n

TTLLLayout has the advantage of faster load time whereas PatternLayout requires roughly 40 milliseconds to load its parser classes. Note that the second run of PatternLayout will be much much faster (approx. 10 micro-seconds).

Fixed format layouts such as TTLLLayout should be considered as an alternative to PatternLayout only if the extra 40 milliseconds at application start-up is considered significant.

Author
Ceki Gülcü
Since
1.1.6

Field Summary

Modifier and TypeField and Description
pack-priv CachingDateFormatter
pack-priv static final char
pack-priv ThrowableProxyConverter
Inherited from ch.qos.logback.core.LayoutBase:
started

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
doLayout(ILoggingEvent
The event to format
event
)

Implements ch.qos.logback.core.Layout.doLayout.

Transform an event (of type Object) and return it as a String after appropriate formatting.
private void
public void
Inherited from ch.qos.logback.core.LayoutBase:
getContentTypegetContextgetFileFootergetFileHeadergetPresentationFootergetPresentationHeaderisStartedsetContextsetFileFootersetFileHeadersetPresentationFootersetPresentationHeaderstop

Field Detail

cachingDateFormatterback to summary
pack-priv CachingDateFormatter cachingDateFormatter
DOUBLE_QUOTE_CHARback to summary
pack-priv static final char DOUBLE_QUOTE_CHAR
tpcback to summary
pack-priv ThrowableProxyConverter tpc

Constructor Detail

TTLLLayoutback to summary
public TTLLLayout()

Method Detail

doLayoutback to summary
public String doLayout(ILoggingEvent event)

Implements ch.qos.logback.core.Layout.doLayout.

Doc from ch.qos.logback.core.Layout.doLayout.

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:ILoggingEvent

The event to format

Returns:String

the event formatted as a String

Annotations
@Override
kvpback to summary
private void kvp(ILoggingEvent event, StringBuilder sb)
startback to summary
public void start()

Overrides ch.qos.logback.core.LayoutBase.start.

Implements ch.qos.logback.core.spi.LifeCycle.start.

Annotations
@Override