public abstract class CompositeJsonEncoder<Event extends DeferredProcessingAware> extends EncoderBase<Event>
started
context
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() |
Encoder<Event> |
getPrefix() |
JsonProviders<Event> |
getProviders() |
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 |
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.
|
protected void |
setLogback11Support(Logback11Support logback11Support) |
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(Encoder<Event> prefix) |
void |
setProviders(JsonProviders<Event> jsonProviders) |
void |
setSuffix(Encoder<Event> suffix) |
void |
start() |
void |
stop() |
isStarted
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, 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 LifeCycle
start
in class EncoderBase<Event extends DeferredProcessingAware>
public void stop()
stop
in interface LifeCycle
stop
in class EncoderBase<Event extends 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
protected void setLogback11Support(Logback11Support logback11Support)
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 setFindAndRegisterJacksonModules(boolean findAndRegisterJacksonModules)
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()
Copyright © 2020. All rights reserved.