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

public Class ConsoleAppender<E>

extends OutputStreamAppender<E>
Class Inheritance
Imports
java.io.OutputStream, .PrintStream, java.lang.reflect.Method, .Modifier, java.util.Arrays, .NoSuchElementException, .Optional, ch.qos.logback.core.joran.spi.ConsoleTarget, ch.qos.logback.core.status.Status, .WarnStatus, ch.qos.logback.core.util.Loader

ConsoleAppender appends log events to System.out or System.err using a layout specified by the user. The default target is System.out.

 

For more information about this appender, please refer to the online manual at http://logback.qos.ch/manual/appenders.html#ConsoleAppender
Authors
Ceki Gülcü, Tom SH Liu, Ruediger Dohna

Field Summary

Modifier and TypeField and Description
private static final String
private static final Class<?>[]
private static final String
private static final String
protected ConsoleTarget
protected boolean
private static final String
private static final String
Inherited from ch.qos.logback.core.OutputStreamAppender:
encoderimmediateFlushstreamWriteLock

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getTarget()

Returns the current value of the target property.

public boolean

Returns:

whether to use JANSI or not.
isWithJansi
()

public void
setTarget(String value)

Sets the value of the Target option.

public void
setWithJansi(boolean
whether to use JANSI or not.
withJansi
)

If true, this appender will output to a stream provided by the JANSI library.

public void
start()

Overrides ch.qos.logback.core.OutputStreamAppender.start.

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

Checks that requires parameters are set and if everything is in order, activates this appender.
private void
private OutputStream
Inherited from ch.qos.logback.core.OutputStreamAppender:
appendcloseOutputStreamencoderCloseencoderInitgetEncodergetOutputStreamisImmediateFlushsetEncodersetImmediateFlushsetLayoutsetOutputStreamstopsubAppendwriteByteArrayToOutputStreamWithPossibleFlushwriteOut

Field Detail

AnsiConsole_CLASS_NAMEback to summary
private static final String AnsiConsole_CLASS_NAME
ARGUMENT_TYPESback to summary
private static final Class<?>[] ARGUMENT_TYPES
JANSI2_ERR_METHOD_NAMEback to summary
private static final String JANSI2_ERR_METHOD_NAME
JANSI2_OUT_METHOD_NAMEback to summary
private static final String JANSI2_OUT_METHOD_NAME
targetback to summary
protected ConsoleTarget target
withJansiback to summary
protected boolean withJansi
wrapSystemErr_METHOD_NAMEback to summary
private static final String wrapSystemErr_METHOD_NAME
wrapSystemOut_METHOD_NAMEback to summary
private static final String wrapSystemOut_METHOD_NAME

Constructor Detail

ConsoleAppenderback to summary
public ConsoleAppender()

Method Detail

getTargetback to summary
public String getTarget()

Returns the current value of the target property. The default value of the option is "System.out".

See also setTarget.

isWithJansiback to summary
public boolean isWithJansi()
Returns:boolean

whether to use JANSI or not.

setTargetback to summary
public void setTarget(String value)

Sets the value of the Target option. Recognized values are "System.out" and "System.err". Any other value will be ignored.

setWithJansiback to summary
public void setWithJansi(boolean withJansi)

If true, this appender will output to a stream provided by the JANSI library.

Parameters
withJansi:boolean

whether to use JANSI or not.

Since
1.0.5
startback to summary
public void start()

Overrides ch.qos.logback.core.OutputStreamAppender.start.

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

Doc from ch.qos.logback.core.OutputStreamAppender.start.

Checks that requires parameters are set and if everything is in order, activates this appender.

Annotations
@Override
targetWarnback to summary
private void targetWarn(String val)
wrapWithJansiback to summary
private OutputStream wrapWithJansi(OutputStream targetStream)