public class LayoutWrappingEncoder<E> extends EncoderBase<E>
Modifier and Type | Field and Description |
---|---|
protected Layout<E> |
layout |
started
context
Constructor and Description |
---|
LayoutWrappingEncoder() |
Modifier and Type | Method and Description |
---|---|
byte[] |
encode(E event)
Encode an event as bytes.
|
byte[] |
footerBytes()
Get footer bytes.
|
Charset |
getCharset() |
Layout<E> |
getLayout() |
byte[] |
headerBytes()
Get header bytes.
|
boolean |
isImmediateFlush() |
boolean |
isStarted() |
void |
setCharset(Charset charset)
Set the charset to use when converting the string returned by the layout
into bytes.
|
void |
setImmediateFlush(boolean immediateFlush)
Sets the immediateFlush option.
|
void |
setLayout(Layout<E> layout) |
void |
start() |
void |
stop() |
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
public void setImmediateFlush(boolean immediateFlush)
immediateFlush
- desired valuepublic boolean isImmediateFlush()
public Charset getCharset()
public void setCharset(Charset charset)
By default this property has the value
null
which corresponds to
the system's default charset.
charset
- desired character setpublic byte[] headerBytes()
Encoder
public byte[] footerBytes()
Encoder
public byte[] encode(E event)
Encoder
event
- the log eventpublic boolean isStarted()
isStarted
in interface LifeCycle
isStarted
in class EncoderBase<E>
public void start()
start
in interface LifeCycle
start
in class EncoderBase<E>
public void stop()
stop
in interface LifeCycle
stop
in class EncoderBase<E>