Class IndentingLayout

  • 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="IndentingLayout",
            elementType="layout",
            category="Core",
            printObject=true)
    public class IndentingLayout
    extends org.apache.logging.log4j.core.layout.AbstractStringLayout
    This is a special Log4j log formatter that is capable of reacting on special log messages and 'indent' the logs accordingly. This is very useful to visually inspect a debug log and see what calls what. An example of logs are > method() and < method() where > and < are used to indicate respectively "entering" and "exiting".
    • Nested Class Summary

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

        org.apache.logging.log4j.core.layout.AbstractStringLayout.Builder<B extends org.apache.logging.log4j.core.layout.AbstractStringLayout.Builder<B>>, org.apache.logging.log4j.core.layout.AbstractStringLayout.Serializer, org.apache.logging.log4j.core.layout.AbstractStringLayout.Serializer2
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Calendar calendar  
      protected static int CONTEXT_SIZE  
      protected int indentation  
      protected static long MAX_DELTA  
      protected long previousTime  
      • 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
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected IndentingLayout​(Charset charset)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static IndentingLayout createLayout​(Charset charset)  
      String toSerializable​(org.apache.logging.log4j.core.LogEvent event)  
      • Methods inherited from class org.apache.logging.log4j.core.layout.AbstractStringLayout

        getBytes, getCharset, getContentType, getFooter, getFooterSerializer, getHeader, getHeaderSerializer, getStringBuilder, getStringBuilderEncoder, requiresLocation, serializeToBytes, serializeToString, toByteArray, trimToMaxSize
      • Methods inherited from class org.apache.logging.log4j.core.layout.AbstractLayout

        encode, getConfiguration, getContentFormat, markEvent
      • Methods inherited from interface org.apache.logging.log4j.core.layout.Encoder

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

        getContentFormat
    • Field Detail

      • previousTime

        protected long previousTime
      • indentation

        protected int indentation
    • Constructor Detail

      • IndentingLayout

        protected IndentingLayout​(Charset charset)
    • Method Detail

      • createLayout

        @PluginFactory
        public static IndentingLayout createLayout​(@PluginAttribute(value="charset",defaultString="UTF-8")
                                                   Charset charset)
      • toSerializable

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