Interface Layout<T extends Serializable>
- Type Parameters:
T- TheSerializabletype returned bytoSerializable(LogEvent)
- All Known Subinterfaces:
StringLayout
- All Known Implementing Classes:
AbstractCsvLayout, AbstractJacksonLayout, AbstractLayout, AbstractStringLayout, CsvLogEventLayout, CsvParameterLayout, GelfLayout, HtmlLayout, JsonLayout, JsonTemplateLayout, LayoutAdapter, Log4j1SyslogLayout, Log4j1XmlLayout, MessageLayout, PatternLayout, Rfc5424Layout, SerializedLayout, SyslogLayout, XmlLayout, YamlLayout
Lays out a LogEvent in different formats.
The formats are:
-
byte[] -
an implementer of Serializable, like
byte[] - String
- LogEvent
Since 2.6, Layouts can encode a LogEvent directly
to a ByteBufferDestination without creating temporary intermediary objects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringMain plugin element type for Layout plugins. -
Method Summary
Modifier and TypeMethodDescriptionReturns a description of the content format.Returns the content type output by this layout.byte[]Returns the format for the layout format.byte[]Returns the header for the layout format.byte[]toByteArray(LogEvent event) Formats the event suitable for display.toSerializable(LogEvent event) Formats the event as an Object that can be serialized.
-
Field Details
-
ELEMENT_TYPE
-
-
Method Details
-
getHeader
byte[] getHeader()Returns the header for the layout format.- Returns:
- The header.
-
toByteArray
Formats the event suitable for display.- Parameters:
event- The Logging Event.- Returns:
- The formatted event.
-
toSerializable
-
getContentType
String getContentType()Returns the content type output by this layout. The base class returns "text/plain".- Returns:
- the content type.
-
getContentFormat