public class ConsoleAppender extends WriterAppender
System.out
or
System.err
using a layout specified by the user. The default
target is System.out
.Modifier and Type | Field and Description |
---|---|
static String |
SYSTEM_ERR |
static String |
SYSTEM_OUT |
protected String |
target |
encoding, immediateFlush, qw
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
Constructor and Description |
---|
ConsoleAppender()
Constructs an unconfigured appender.
|
ConsoleAppender(Layout layout)
Creates a configured appender.
|
ConsoleAppender(Layout layout,
String target)
Creates a configured appender.
|
Modifier and Type | Method and Description |
---|---|
void |
activateOptions()
Prepares the appender for use.
|
protected void |
closeWriter()
Close the underlying
Writer . |
boolean |
getFollow()
Gets whether the appender honors reassignments of System.out or System.err made after configuration.
|
String |
getTarget()
Returns the current value of the Target property.
|
void |
setFollow(boolean newValue)
Sets whether the appender honors reassignments of System.out or System.err made after configuration.
|
void |
setTarget(String value)
Sets the value of the Target option.
|
append, checkEntryConditions, close, createWriter, getEncoding, getImmediateFlush, requiresLayout, reset, setEncoding, setErrorHandler, setImmediateFlush, setWriter, shouldFlush, subAppend, writeFooter, writeHeader
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setLayout, setName, setThreshold
public static final String SYSTEM_OUT
public static final String SYSTEM_ERR
protected String target
public ConsoleAppender()
public ConsoleAppender(Layout layout)
layout
- layout, may not be null.public void setTarget(String value)
public String getTarget()
See also setTarget(java.lang.String)
.
public final void setFollow(boolean newValue)
newValue
- if true, appender will use value of System.out or System.err in force at the time when logging
events are appended.public final boolean getFollow()
public void activateOptions()
activateOptions
in interface OptionHandler
activateOptions
in class WriterAppender
protected final void closeWriter()
Writer
.closeWriter
in class WriterAppender
Copyright © 1999–2023 QOS.CH Sarl (Switzerland). All rights reserved.