Class ConsoleAppender<E>

All Implemented Interfaces:
Appender<E>, ContextAware, FilterAttachable<E>, LifeCycle

public class ConsoleAppender<E> extends OutputStreamAppender<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ü, Tom SH Liu, Ruediger Dohna
  • Field Details

  • Constructor Details

  • Method Details

    • 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: OutputStreamAppender
      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 OutputStreamAppender<E>
    • isWithJansi

      public boolean isWithJansi()
      Returns:
      whether to use JANSI or not.
    • setWithJansi

      public void setWithJansi(boolean withJansi)
      If true, this appender will output to a stream provided by the JANSI library.
      Parameters:
      withJansi - whether to use JANSI or not.
      Since:
      1.0.5