Class CompositeJsonLayout<Event extends DeferredProcessingAware>

java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.LayoutBase<Event>
net.logstash.logback.layout.CompositeJsonLayout<Event>
All Implemented Interfaces:
Layout<Event>, ContextAware, LifeCycle
Direct Known Subclasses:
AccessEventCompositeJsonLayout, LoggingEventCompositeJsonLayout

public abstract class CompositeJsonLayout<Event extends DeferredProcessingAware> extends LayoutBase<Event>
  • Constructor Details

    • CompositeJsonLayout

      public CompositeJsonLayout()
  • Method Details

    • createFormatter

      protected abstract AbstractCompositeJsonFormatter<Event> createFormatter()
    • doLayout

      public String doLayout(Event event)
    • start

      public void start()
      Specified by:
      start in interface LifeCycle
      Overrides:
      start in class LayoutBase<Event extends DeferredProcessingAware>
    • stop

      public void stop()
      Specified by:
      stop in interface LifeCycle
      Overrides:
      stop in class LayoutBase<Event extends DeferredProcessingAware>
    • getProviders

      public JsonProviders<Event> getProviders()
    • setProviders

      public void setProviders(JsonProviders<Event> jsonProviders)
    • isImmediateFlush

      public boolean isImmediateFlush()
    • setImmediateFlush

      public void setImmediateFlush(boolean immediateFlush)
    • getJsonFactoryDecorator

      public JsonFactoryDecorator getJsonFactoryDecorator()
    • setJsonFactoryDecorator

      public void setJsonFactoryDecorator(JsonFactoryDecorator jsonFactoryDecorator)
    • getJsonGeneratorDecorator

      public JsonGeneratorDecorator getJsonGeneratorDecorator()
    • setJsonGeneratorDecorator

      public void setJsonGeneratorDecorator(JsonGeneratorDecorator jsonGeneratorDecorator)
    • setFindAndRegisterJacksonModules

      public void setFindAndRegisterJacksonModules(boolean findAndRegisterJacksonModules)
    • getFormatter

      protected AbstractCompositeJsonFormatter<Event> getFormatter()
    • getPrefix

      public Layout<Event> getPrefix()
    • setPrefix

      public void setPrefix(Layout<Event> prefix)
    • getSuffix

      public Layout<Event> getSuffix()
    • setSuffix

      public void setSuffix(Layout<Event> suffix)
    • getLineSeparator

      public String getLineSeparator()
    • setLineSeparator

      public void setLineSeparator(String lineSeparator)
      Sets which lineSeparator to use between events. The following values have special meaning:
      • null or empty string = no new line. (default)
      • "SYSTEM" = operating system new line.
      • "UNIX" = unix line ending (\n).
      • "WINDOWS" = windows line ending (\r\n).
      Any other value will be used as given as the lineSeparator.
      Parameters:
      lineSeparator - the separator format
    • getMinBufferSize

      public int getMinBufferSize()
    • setMinBufferSize

      public void setMinBufferSize(int minBufferSize)
      The minimum size of the byte buffer used when encoding events.

      The buffer automatically grows above the #minBufferSize when needed to accommodate with larger events. However, only the first minBufferSize bytes will be reused by subsequent invocations. It is therefore strongly advised to set the minimum size at least equal to the average size of the encoded events to reduce unnecessary memory allocations and reduce pressure on the garbage collector.

      Note: changes to the buffer size will not be taken into account after the encoder is started.

      Parameters:
      minBufferSize - the minimum buffer size (in bytes)