Class EcsLayout

java.lang.Object
org.apache.logging.log4j.core.layout.AbstractLayout<String>
org.apache.logging.log4j.core.layout.AbstractStringLayout
co.elastic.logging.log4j2.EcsLayout
All Implemented Interfaces:
org.apache.logging.log4j.core.impl.LocationAware, org.apache.logging.log4j.core.Layout<String>, org.apache.logging.log4j.core.layout.Encoder<org.apache.logging.log4j.core.LogEvent>, org.apache.logging.log4j.core.StringLayout

@Plugin(name="EcsLayout", category="Core", elementType="layout") public class EcsLayout extends org.apache.logging.log4j.core.layout.AbstractStringLayout
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout

    org.apache.logging.log4j.core.layout.AbstractStringLayout.Serializer, org.apache.logging.log4j.core.layout.AbstractStringLayout.Serializer2
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Charset
     

    Fields inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout

    DEFAULT_STRING_BUILDER_SIZE, MAX_STRING_BUILDER_SIZE

    Fields inherited from class org.apache.logging.log4j.core.layout.AbstractLayout

    configuration, eventCount, footer, header, LOGGER

    Fields inherited from interface org.apache.logging.log4j.core.Layout

    ELEMENT_TYPE
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    encode(org.apache.logging.log4j.core.LogEvent event, org.apache.logging.log4j.core.layout.ByteBufferDestination destination)
     
     
     
    toSerializable(org.apache.logging.log4j.core.LogEvent event)
     

    Methods inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout

    getBytes, getCharset, getFooter, getFooterSerializer, getHeader, getHeaderSerializer, getStringBuilder, getStringBuilderEncoder, requiresLocation, serializeToBytes, serializeToString, toByteArray, trimToMaxSize

    Methods inherited from class org.apache.logging.log4j.core.layout.AbstractLayout

    getConfiguration, getContentFormat, markEvent

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.logging.log4j.core.Layout

    getContentFormat
  • Field Details

    • UTF_8

      public static final Charset UTF_8
  • Method Details

    • newBuilder

      @PluginBuilderFactory public static EcsLayout.Builder newBuilder()
    • toSerializable

      public String toSerializable(org.apache.logging.log4j.core.LogEvent event)
    • encode

      public void encode(org.apache.logging.log4j.core.LogEvent event, org.apache.logging.log4j.core.layout.ByteBufferDestination destination)
      Specified by:
      encode in interface org.apache.logging.log4j.core.layout.Encoder<org.apache.logging.log4j.core.LogEvent>
      Overrides:
      encode in class org.apache.logging.log4j.core.layout.AbstractLayout<String>
    • getContentType

      public String getContentType()
      Specified by:
      getContentType in interface org.apache.logging.log4j.core.Layout<String>
      Overrides:
      getContentType in class org.apache.logging.log4j.core.layout.AbstractStringLayout