public class LayoutWrappingEncoder<E> extends EncoderBase<E>
| Modifier and Type | Field and Description |
|---|---|
protected Layout |
layout
|
outputStream, startedcontext| Constructor and Description |
|---|
LayoutWrappingEncoder()
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
This method is called prior to the closing of the underling
OutputStream.
|
void |
doEncode(E event)
Encode and write an event to the appropriate
OutputStream.
|
Charset |
getCharset()
|
Layout |
getLayout()
|
void |
init(OutputStream
This method is called when the owning appender starts or whenever output needs to be directed to a new OutputStream, for instance as a result of a rollover.
|
boolean |
isImmediateFlush()
|
boolean |
isStarted()
|
void |
setCharset(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
|
void |
start()
|
void |
stop()
|
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContextpublic void setImmediateFlush(boolean immediateFlush)
public boolean isImmediateFlush()
public CharsetgetCharset()
public void setCharset(Charsetcharset)
null which corresponds to the system's default charset.
charset -
public void init(OutputStreamos) throws IOException
Encoder
init in interface
Encoder<E>
init in class
EncoderBase<E>
IOException -
public void close()
throws IOException
Encoder
OutputStream. Implementations MUST not close the underlying
OutputStream which is the responsibility of the owning appender.
IOException -
public void doEncode(E event) throws IOException
Encoder
OutputStream. Implementations are free to differ writing out of the encoded event and instead write in batches.
IOException -
public boolean isStarted()
public void start()
public void stop()