org.apache.log4j
Class ConsoleAppender
java.lang.Object
org.apache.log4j.AppenderSkeleton
org.apache.log4j.WriterAppender
org.apache.log4j.ConsoleAppender
- All Implemented Interfaces:
- Appender, OptionHandler
public class ConsoleAppender
- extends WriterAppender
ConsoleAppender appends log events to System.out
or
System.err
using a layout specified by the user. The
default target is System.out
.
- Since:
- 1.1
- Author:
- Ceki Gülcü
Methods inherited from class org.apache.log4j.WriterAppender |
append, checkEntryConditions, close, createWriter, getEncoding, getImmediateFlush, requiresLayout, reset, setEncoding, setErrorHandler, setImmediateFlush, setWriter, subAppend, writeFooter, writeHeader |
Methods inherited from class org.apache.log4j.AppenderSkeleton |
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setLayout, setName, setThreshold |
SYSTEM_OUT
public static final String SYSTEM_OUT
- See Also:
- Constant Field Values
SYSTEM_ERR
public static final String SYSTEM_ERR
- See Also:
- Constant Field Values
target
protected String target
ConsoleAppender
public ConsoleAppender()
- The default constructor does nothing.
ConsoleAppender
public ConsoleAppender(Layout layout)
ConsoleAppender
public ConsoleAppender(Layout layout,
String target)
setTarget
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.
getTarget
public String getTarget()
- Returns the current value of the Target property. The
default value of the option is "System.out".
See also
setTarget(java.lang.String)
.
activateOptions
public void activateOptions()
- Description copied from class:
WriterAppender
- Does nothing.
- Specified by:
activateOptions
in interface OptionHandler
- Overrides:
activateOptions
in class WriterAppender
closeWriter
protected final void closeWriter()
- This method overrides the parent
WriterAppender.closeWriter()
implementation to do nothing because
the console stream is not ours to close.
- Overrides:
closeWriter
in class WriterAppender
Copyright 2000-2005 Apache Software Foundation.