public class ConsoleAppender extends WriterAppender
System.out
or
System.err
using a layout specified by the user. The
default target is System.out
.限定符和类型 | 字段和说明 |
---|---|
static java.lang.String |
SYSTEM_ERR |
static java.lang.String |
SYSTEM_OUT |
protected java.lang.String |
target |
encoding, immediateFlush, qw
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
构造器和说明 |
---|
ConsoleAppender()
Constructs an unconfigured appender.
|
ConsoleAppender(Layout layout)
Creates a configured appender.
|
ConsoleAppender(Layout layout,
java.lang.String target)
Creates a configured appender.
|
限定符和类型 | 方法和说明 |
---|---|
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.
|
java.lang.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(java.lang.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 java.lang.String SYSTEM_OUT
public static final java.lang.String SYSTEM_ERR
protected java.lang.String target
public ConsoleAppender()
public ConsoleAppender(Layout layout)
layout
- layout, may not be null.public ConsoleAppender(Layout layout, java.lang.String target)
layout
- layout, may not be null.target
- target, either "System.err" or "System.out".public void setTarget(java.lang.String value)
public java.lang.String getTarget()
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
在接口中 OptionHandler
activateOptions
在类中 WriterAppender
protected final void closeWriter()
Writer
.closeWriter
在类中 WriterAppender