public abstract class CompositeJsonEncoder<Event extends ch.qos.logback.core.spi.DeferredProcessingAware>
extends ch.qos.logback.core.encoder.EncoderBase<Event>
Constructor and Description |
---|
CompositeJsonEncoder() |
Modifier and Type | Method and Description |
---|---|
void |
close()
This is an overridden method from
Encoder from logback 1.1. |
protected abstract CompositeJsonFormatter<Event> |
createFormatter() |
void |
doEncode(Event event)
This is an overridden method from
Encoder from logback 1.1. |
void |
doEncode(Object event)
This is an overridden method from
Encoder from logback 1.1. |
byte[] |
encode(Event event) |
byte[] |
footerBytes() |
String |
getEncoding() |
protected CompositeJsonFormatter<Event> |
getFormatter() |
JsonFactoryDecorator |
getJsonFactoryDecorator() |
JsonGeneratorDecorator |
getJsonGeneratorDecorator() |
String |
getLineSeparator() |
int |
getMinBufferSize() |
ch.qos.logback.core.encoder.Encoder<Event> |
getPrefix() |
JsonProviders<Event> |
getProviders() |
ch.qos.logback.core.encoder.Encoder<Event> |
getSuffix() |
byte[] |
headerBytes() |
void |
init(OutputStream outputStream)
This is an overridden method from
Encoder from logback 1.1. |
boolean |
isImmediateFlush() |
void |
setEncoding(String encodingName)
The character encoding to use (default = "UTF-8").
|
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)
Sets the minimum size of the byte array buffer used when
encoding events in logback versions greater than or equal to 1.2.0.
|
void |
setPrefix(ch.qos.logback.core.encoder.Encoder<Event> prefix) |
void |
setProviders(JsonProviders<Event> jsonProviders) |
void |
setSuffix(ch.qos.logback.core.encoder.Encoder<Event> suffix) |
void |
start() |
void |
stop() |
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
protected abstract CompositeJsonFormatter<Event> createFormatter()
public void init(OutputStream outputStream) throws IOException
Encoder
from logback 1.1.
It sets the OutputStream
to which this encoder should write encoded events.
This method is not part of the Encoder
interface in logback 1.2,
therefore, logback 1.2+ will not call this method.IllegalStateException
- if the logback version is >= 1.2IOException
public byte[] encode(Event event)
public void doEncode(Object event) throws IOException
Encoder
from logback 1.1.
It encodes the event to the OutputStream
passed to
the init(OutputStream)
method.
This method takes the place of the bridge method that would have
been generated by the compiler when compiled against logback 1.1.
This method is not part of the Encoder
interface in logback 1.2,
therefore, logback 1.2+ will not call this method.IllegalStateException
- if the logback version is >= 1.2IOException
public void doEncode(Event event) throws IOException
Encoder
from logback 1.1.
It encodes the event to the OutputStream
passed to
the init(OutputStream)
method.
This method is not part of the Encoder
interface in logback 1.2,
therefore, logback 1.2+ will not call this method.IllegalStateException
- if the logback version is >= 1.2IOException
public void start()
start
in interface ch.qos.logback.core.spi.LifeCycle
start
in class ch.qos.logback.core.encoder.EncoderBase<Event extends ch.qos.logback.core.spi.DeferredProcessingAware>
public void stop()
stop
in interface ch.qos.logback.core.spi.LifeCycle
stop
in class ch.qos.logback.core.encoder.EncoderBase<Event extends ch.qos.logback.core.spi.DeferredProcessingAware>
public void close() throws IOException
Encoder
from logback 1.1.
It closes this encoder.
It is called prior to closing the underlying outputstream.
This method is not part of the Encoder
interface in logback 1.2,
therefore, logback 1.2+ will not call this method.IllegalStateException
- if the logback version is >= 1.2IOException
public byte[] headerBytes()
public byte[] footerBytes()
public JsonProviders<Event> getProviders()
public void setProviders(JsonProviders<Event> jsonProviders)
public boolean isImmediateFlush()
public void setImmediateFlush(boolean immediateFlush)
public JsonFactoryDecorator getJsonFactoryDecorator()
public void setJsonFactoryDecorator(JsonFactoryDecorator jsonFactoryDecorator)
public JsonGeneratorDecorator getJsonGeneratorDecorator()
public String getEncoding()
public void setEncoding(String encodingName)
JsonEncoding
public void setJsonGeneratorDecorator(JsonGeneratorDecorator jsonGeneratorDecorator)
public String getLineSeparator()
public void setLineSeparator(String lineSeparator)
The following values have special meaning:
Any other value will be used as given as the lineSeparator.
public int getMinBufferSize()
public void setMinBufferSize(int minBufferSize)
minBufferSize
plus the prefix, suffix, and line separators sizes.protected CompositeJsonFormatter<Event> getFormatter()
public ch.qos.logback.core.encoder.Encoder<Event> getPrefix()
public void setPrefix(ch.qos.logback.core.encoder.Encoder<Event> prefix)
public ch.qos.logback.core.encoder.Encoder<Event> getSuffix()
public void setSuffix(ch.qos.logback.core.encoder.Encoder<Event> suffix)
Copyright © 2017. All Rights Reserved.