java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.encoder.EncoderBase<E>
ch.qos.logback.core.encoder.LayoutWrappingEncoder<E>
- All Implemented Interfaces:
Encoder<E>
,ContextAware
,LifeCycle
- Direct Known Subclasses:
PatternLayoutEncoderBase
-
Field Summary
Fields inherited from class ch.qos.logback.core.encoder.EncoderBase
started
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Encode an event as bytes.byte[]
Get footer bytes.byte[]
Get header bytes.boolean
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
void
setParent
(ContextAware parent) This method allows RollingPolicy implementations to be aware of their containing appender.void
start()
void
stop()
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Field Details
-
layout
-
-
Constructor Details
-
LayoutWrappingEncoder
public LayoutWrappingEncoder()
-
-
Method Details
-
getLayout
-
setLayout
-
getCharset
-
setCharset
Set the charset to use when converting the string returned by the layout into bytes.By default this property has the value
null
which corresponds to the system's default charset.- Parameters:
charset
-
-
setImmediateFlush
Sets the immediateFlush option. The default value for immediateFlush is 'true'. If set to true, the doEncode() method will immediately flush the underlying OutputStream. Although immediate flushing is safer, it also significantly degrades logging throughput.- Since:
- 1.0.3
-
headerBytes
Description copied from interface:Encoder
Get header bytes. This method is typically called upon opening of an output stream.- Returns:
- header bytes. Null values are allowed.
-
encode
Description copied from interface:Encoder
Encode an event as bytes.- Parameters:
event
-
-
isStarted
- Specified by:
isStarted
in interfaceLifeCycle
- Overrides:
isStarted
in classEncoderBase<E>
-
start
- Specified by:
start
in interfaceLifeCycle
- Overrides:
start
in classEncoderBase<E>
-
stop
- Specified by:
stop
in interfaceLifeCycle
- Overrides:
stop
in classEncoderBase<E>
-
setParent
This method allows RollingPolicy implementations to be aware of their containing appender.- Parameters:
parent
-
-