Log4j 1.1b7

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ü

Field Summary
static String SYSTEM_ERR
           
static String SYSTEM_OUT
           
protected  String target
           
static String TARGET_OPTION
          Deprecated. Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.
 
Fields inherited from class org.apache.log4j.WriterAppender
IMMEDIATE_FLUSH_OPTION, immediateFlush, qw
 
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold, THRESHOLD_OPTION
 
Constructor Summary
ConsoleAppender()
          The default constructor does nothing.
ConsoleAppender(Layout layout)
           
ConsoleAppender(Layout layout, String target)
           
 
Method Summary
 void activateOptions()
          Does nothing.
protected  void closeWriter()
          Override the parent method to do nothing.
 String[] getOptionStrings()
          Deprecated. We now use JavaBeans introspection to configure components. Options strings are no longer needed.
 String getTarget()
          Returns the current value of the Target option.
 void setOption(String key, String value)
          Deprecated. Use the setter method for the option directly instead of the generic setOption method.
 void setTarget(String value)
          Sets the value of the Target option.
 
Methods inherited from class org.apache.log4j.WriterAppender
append, checkEntryConditions, close, getImmediateFlush, requiresLayout, reset, 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
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYSTEM_OUT

public static final String SYSTEM_OUT

SYSTEM_ERR

public static final String SYSTEM_ERR

TARGET_OPTION

public static final String TARGET_OPTION
Deprecated. Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.


target

protected String target
Constructor Detail

ConsoleAppender

public ConsoleAppender()
The default constructor does nothing.

ConsoleAppender

public ConsoleAppender(Layout layout)

ConsoleAppender

public ConsoleAppender(Layout layout,
                       String target)
Method Detail

setTarget

public void setTarget(String value)
Sets the value of the Target option.
Parameters:
value - String identifying a console; recognized values are "System.out" (default) and "System.err"

getTarget

public String getTarget()
Returns the current value of the Target option.

activateOptions

public void activateOptions()
Description copied from class: WriterAppender
Does nothing.
Overrides:
activateOptions in class WriterAppender

closeWriter

protected final void closeWriter()
Override the parent method to do nothing.
Overrides:
closeWriter in class WriterAppender

getOptionStrings

public String[] getOptionStrings()
Deprecated. We now use JavaBeans introspection to configure components. Options strings are no longer needed.

Returns the option names for this component, namely the string array {TARGET_OPTION and the options of its super class WriterAppender. See Options of the super classes WriterAppender and AppenderSkeleton. In particular the Threshold option.
Overrides:
getOptionStrings in class WriterAppender

setOption

public void setOption(String key,
                      String value)
Deprecated. Use the setter method for the option directly instead of the generic setOption method.

Set ConsoleAppender specific options. The Target option is recognized on top of options for the super class WriterAppender.
Overrides:
setOption in class WriterAppender

Log4j 1.1b7

Please notify me about new log4j releases.