Interface Layout<T extends Serializable>

Type Parameters:
T - The Serializable type returned by toSerializable(LogEvent)
All Superinterfaces:
Encoder<LogEvent>
All Known Subinterfaces:
StringLayout
All Known Implementing Classes:
AbstractCsvLayout, AbstractLayout, AbstractStringLayout, CsvLogEventLayout, CsvParameterLayout, GelfLayout, HtmlLayout, JsonLayout, MessageLayout, PatternLayout, Rfc5424Layout, SerializedLayout, SyslogLayout, XmlLayout, YamlLayout

public interface Layout<T extends Serializable> extends Encoder<LogEvent>
Lays out a LogEvent in different formats. The formats are:

Since 2.6, Layouts can encode a LogEvent directly to a ByteBufferDestination without creating temporary intermediary objects.

  • Field Details

  • Method Details

    • getFooter

      byte[] getFooter()
      Returns the format for the layout format.
      Returns:
      The footer.
    • getHeader

      byte[] getHeader()
      Returns the header for the layout format.
      Returns:
      The header.
    • toByteArray

      byte[] toByteArray(LogEvent event)
      Formats the event suitable for display.
      Parameters:
      event - The Logging Event.
      Returns:
      The formatted event.
    • toSerializable

      T toSerializable(LogEvent event)
      Formats the event as an Object that can be serialized.
      Parameters:
      event - The Logging Event.
      Returns:
      The formatted event.
    • getContentType

      String getContentType()
      Returns the content type output by this layout. The base class returns "text/plain".
      Returns:
      the content type.
    • getContentFormat

      Map<String,String> getContentFormat()
      Returns a description of the content format.
      Returns:
      a Map of key/value pairs describing the Layout-specific content format, or an empty Map if no content format descriptors are specified.