Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LOGBACK-1326 Allow LayoutWrappingEncoder to have a parent of a type other than Appender #383

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

import java.nio.charset.Charset;

import ch.qos.logback.core.Appender;
import ch.qos.logback.core.CoreConstants;
import ch.qos.logback.core.Layout;
import ch.qos.logback.core.OutputStreamAppender;
import ch.qos.logback.core.spi.ContextAware;

public class LayoutWrappingEncoder<E> extends EncoderBase<E> {

Expand All @@ -33,8 +33,8 @@ public class LayoutWrappingEncoder<E> extends EncoderBase<E> {
*/
private Charset charset;

Appender<?> parent;
Boolean immediateFlush = null;
private ContextAware parent;
private Boolean immediateFlush;

public Layout<E> getLayout() {
return layout;
Expand All @@ -52,7 +52,7 @@ public Charset getCharset() {
* Set the charset to use when converting the string returned by the layout
* into bytes.
* <p/>
* By default this property has the value
* By default this propertyhas the value
philsttr marked this conversation as resolved.
Show resolved Hide resolved
* <code>null</null> which corresponds to
* the system's default charset.
*
Expand Down Expand Up @@ -145,12 +145,11 @@ private void appendIfNotNull(StringBuilder sb, String s) {
}

/**
* This method allows RollingPolicy implementations to be aware of their
* containing appender.
* This method allows RollingPolicy implementations to be aware of their parent.
*
* @param appender
* @param parent
*/
public void setParent(Appender<?> parent) {
public void setParent(ContextAware parent) {
this.parent = parent;
}
}