Package chapters.migrationFromLog4j
Class TrivialLogbackLayout
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.LayoutBase<ILoggingEvent>
-
- chapters.migrationFromLog4j.TrivialLogbackLayout
-
- All Implemented Interfaces:
Layout<ILoggingEvent>
,ContextAware
,LifeCycle
public class TrivialLogbackLayout extends LayoutBase<ILoggingEvent>
A very simple logback-classic layout which formats a logging event by returning the message contained therein.
-
-
Field Summary
-
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 TrivialLogbackLayout()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
doLayout(ILoggingEvent loggingEvent)
Transform an event (of type Object) and return it as a String after appropriate formatting.-
Methods inherited from class ch.qos.logback.core.LayoutBase
getContentType, getContext, getFileFooter, getFileHeader, getPresentationFooter, getPresentationHeader, isStarted, setContext, setFileFooter, setFileHeader, setPresentationFooter, setPresentationHeader, start, stop
-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getDeclaredOrigin, getStatusManager
-
-
-
-
Method Detail
-
doLayout
public java.lang.String doLayout(ILoggingEvent loggingEvent)
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:
loggingEvent
- The event to format- Returns:
- the event formatted as a String
-
-