Package net.logstash.logback.layout
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 ch.qos.logback.core.LayoutBase
started
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AbstractCompositeJsonFormatter<Event>
protected AbstractCompositeJsonFormatter<Event>
int
boolean
void
setFindAndRegisterJacksonModules
(boolean findAndRegisterJacksonModules) void
setImmediateFlush
(boolean immediateFlush) void
setJsonFactoryDecorator
(JsonFactoryDecorator jsonFactoryDecorator) void
setJsonGeneratorDecorator
(JsonGeneratorDecorator jsonGeneratorDecorator) void
setLineSeparator
(String lineSeparator) Sets which lineSeparator to use between events.void
setMinBufferSize
(int minBufferSize) The minimum size of the byte buffer used when encoding events.void
void
setProviders
(JsonProviders<Event> jsonProviders) void
void
start()
void
stop()
Methods inherited from class ch.qos.logback.core.LayoutBase
getContentType, getContext, getFileFooter, getFileHeader, getPresentationFooter, getPresentationHeader, isStarted, setContext, setFileFooter, setFileHeader, setPresentationFooter, setPresentationHeader
Methods inherited from class ch.qos.logback.core.spi.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:
start
in interfaceLifeCycle
- Overrides:
start
in classLayoutBase<Event extends DeferredProcessingAware>
-
stop
public void stop()- Specified by:
stop
in interfaceLifeCycle
- Overrides:
stop
in classLayoutBase<Event extends DeferredProcessingAware>
-
getProviders
-
setProviders
-
isImmediateFlush
public boolean isImmediateFlush() -
setImmediateFlush
public void setImmediateFlush(boolean immediateFlush) -
getJsonFactoryDecorator
-
setJsonFactoryDecorator
-
getJsonGeneratorDecorator
-
setJsonGeneratorDecorator
-
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:null
or 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
#minBufferSize
when needed to accommodate with larger events. However, only the firstminBufferSize
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)
-