Logback API
Version 0.9.8

ch.qos.logback.core
Class ConsoleAppender<E>

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by ch.qos.logback.core.AppenderBase<E>
          extended by ch.qos.logback.core.WriterAppender<E>
              extended by ch.qos.logback.core.ConsoleAppender<E>
All Implemented Interfaces:
Appender<E>, ContextAware, FilterAttachable, LifeCycle

public class ConsoleAppender<E>
extends WriterAppender<E>

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

Author:
Ceki Gülcü

Field Summary
static String SYSTEM_ERR
           
static String SYSTEM_OUT
           
protected  String target
           
 
Fields inherited from class ch.qos.logback.core.WriterAppender
encoding, immediateFlush, layout, writer
 
Fields inherited from class ch.qos.logback.core.AppenderBase
name, started
 
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
 
Constructor Summary
ConsoleAppender()
          As in most cases, the default constructor does nothing.
 
Method Summary
protected  void closeWriter()
          This method overrides the parent WriterAppender.closeWriter() implementation because the console stream is not ours to close.
 String getTarget()
          Returns the current value of the Target property.
 void setTarget(String value)
          Sets the value of the Target option.
 void start()
          Checks that requires parameters are set and if everything is in order, activates this appender.
 
Methods inherited from class ch.qos.logback.core.WriterAppender
append, createWriter, getEncoding, getImmediateFlush, getLayout, setEncoding, setImmediateFlush, setLayout, setWriter, stop, subAppend
 
Methods inherited from class ch.qos.logback.core.AppenderBase
addFilter, clearAllFilters, doAppend, getFilterChainDecision, getFirstFilter, getName, isStarted, setName, toString
 
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getStatusManager, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
 

Field Detail

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
Constructor Detail

ConsoleAppender

public ConsoleAppender()
As in most cases, the default constructor does nothing.

Method Detail

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).


start

public void start()
Description copied from class: WriterAppender
Checks that requires parameters are set and if everything is in order, activates this appender.

Specified by:
start in interface LifeCycle
Overrides:
start in class WriterAppender<E>

closeWriter

protected final void closeWriter()
This method overrides the parent WriterAppender.closeWriter() implementation because the console stream is not ours to close.

Overrides:
closeWriter in class WriterAppender<E>

Logback API
Version 0.9.8

Copyright © 2005-2008 QOS.ch. All Rights Reserved.