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>
-
Field Summary
Fields inherited from class LayoutBase
startedFields inherited from class ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDecorator(Decorator<?> decorator) protected abstract AbstractCompositeJsonFormatter<Event> protected AbstractCompositeJsonFormatter<Event> intbooleanvoidsetDataFormat(String dataFormat) voidsetDataFormatFactory(DataFormatFactory dataFormatFactory) voidsetFindAndRegisterJacksonModules(boolean findAndRegisterJacksonModules) voidsetImmediateFlush(boolean immediateFlush) voidsetLineSeparator(String lineSeparator) Sets which lineSeparator to use between events.voidsetMinBufferSize(int minBufferSize) The minimum size of the byte buffer used when encoding events.voidvoidsetProviders(JsonProviders<Event> jsonProviders) voidvoidstart()voidstop()Methods inherited from class LayoutBase
getContentType, getContext, getFileFooter, getFileHeader, getPresentationFooter, getPresentationHeader, isStarted, setContext, setFileFooter, setFileHeader, setPresentationFooter, setPresentationHeaderMethods inherited from class ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getDeclaredOrigin, getStatusManager
-
Constructor Details
-
CompositeJsonLayout
public CompositeJsonLayout()
-
-
Method Details
-
createFormatter
-
doLayout
-
start
public void start()- Specified by:
startin interfaceLifeCycle- Overrides:
startin classLayoutBase<Event extends DeferredProcessingAware>
-
stop
public void stop()- Specified by:
stopin interfaceLifeCycle- Overrides:
stopin classLayoutBase<Event extends DeferredProcessingAware>
-
getProviders
-
setProviders
-
isImmediateFlush
public boolean isImmediateFlush() -
setImmediateFlush
public void setImmediateFlush(boolean immediateFlush) -
getDataFormat
-
setDataFormat
-
getDataFormatFactory
-
setDataFormatFactory
-
addDecorator
-
getTokenStreamFactoryBuilderDecorator
-
getMapperBuilderDecorator
-
getJsonGeneratorDecorator
-
setFindAndRegisterJacksonModules
public void setFindAndRegisterJacksonModules(boolean findAndRegisterJacksonModules) -
getFormatter
-
getPrefix
-
setPrefix
-
getSuffix
-
setSuffix
-
getLineSeparator
-
setLineSeparator
Sets which lineSeparator to use between events. The following values have special meaning:nullor empty string = no new line. (default)- "
SYSTEM" = operating system new line. - "
UNIX" = unix line ending (\n). - "
WINDOWS" = windows line ending (\r\n).
- 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
#minBufferSizewhen needed to accommodate with larger events. However, only the firstminBufferSizebytes 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)
-