Top Fields Constructors Methods
ch.qos.logback.core.encoder

public Class LayoutWrappingEncoder<E>

extends EncoderBase<E>
Class Inheritance
Known Direct Subclasses
ch.qos.logback.core.pattern.PatternLayoutEncoderBase
Imports
java.nio.charset.Charset, ch.qos.logback.core.CoreConstants, .Layout, .OutputStreamAppender, ch.qos.logback.core.spi.ContextAware

Field Summary

Modifier and TypeField and Description
private Charset
charset

The charset to use when converting a String into bytes.

pack-priv Boolean
protected Layout<E>
pack-priv ContextAware
Inherited from ch.qos.logback.core.encoder.EncoderBase:
started

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private byte[]
public byte[]
encode(E event)

Implements ch.qos.logback.core.encoder.Encoder.encode.

Encode an event as bytes.
public byte[]
public Charset
public Layout<E>
public byte[]
public boolean
public void
setCharset(Charset charset)

Set the charset to use when converting the string returned by the layout into bytes.

public void
setImmediateFlush(boolean immediateFlush)

Sets the immediateFlush option.

public void
setLayout(Layout<E> layout)

public void
setParent(ContextAware parent)

This method allows RollingPolicy implementations to be aware of their containing appender.

public void
public void

Field Detail

charsetback to summary
private Charset charset

The charset to use when converting a String into bytes.

By default this property has the value null which corresponds to the system's default charset.

immediateFlushback to summary
pack-priv Boolean immediateFlush
layoutback to summary
protected Layout<E> layout
parentback to summary
pack-priv ContextAware parent

Constructor Detail

LayoutWrappingEncoderback to summary
public LayoutWrappingEncoder()

Method Detail

appendIfNotNullback to summary
private void appendIfNotNull(StringBuilder sb, String s)
convertToBytesback to summary
private byte[] convertToBytes(String s)
encodeback to summary
public byte[] encode(E event)

Implements ch.qos.logback.core.encoder.Encoder.encode.

Doc from ch.qos.logback.core.encoder.Encoder.encode.

Encode an event as bytes.

footerBytesback to summary
public byte[] footerBytes()

Implements ch.qos.logback.core.encoder.Encoder.footerBytes.

Doc from ch.qos.logback.core.encoder.Encoder.footerBytes.

Get footer bytes. This method is typically called prior to the closing of the stream where events are written.

Returns:byte[]

footer bytes. Null values are allowed.

Annotations
@Override
getCharsetback to summary
public Charset getCharset()
getLayoutback to summary
public Layout<E> getLayout()
headerBytesback to summary
public byte[] headerBytes()

Implements ch.qos.logback.core.encoder.Encoder.headerBytes.

Doc from ch.qos.logback.core.encoder.Encoder.headerBytes.

Get header bytes. This method is typically called upon opening of an output stream.

Returns:byte[]

header bytes. Null values are allowed.

Annotations
@Override
isStartedback to summary
public boolean isStarted()

Overrides ch.qos.logback.core.encoder.EncoderBase.isStarted.

Implements ch.qos.logback.core.spi.LifeCycle.isStarted.

setCharsetback to summary
public void setCharset(Charset charset)

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.

setImmediateFlushback to summary
public void setImmediateFlush(boolean immediateFlush)

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
setLayoutback to summary
public void setLayout(Layout<E> layout)
setParentback to summary
public void setParent(ContextAware parent)

This method allows RollingPolicy implementations to be aware of their containing appender.

startback to summary
public void start()

Overrides ch.qos.logback.core.encoder.EncoderBase.start.

Implements ch.qos.logback.core.spi.LifeCycle.start.

stopback to summary
public void stop()

Overrides ch.qos.logback.core.encoder.EncoderBase.stop.

Implements ch.qos.logback.core.spi.LifeCycle.stop.