Class Log4jPrintStream

All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public class Log4jPrintStream extends PrintStream
A PrintStream that flushes out to a log4j Category.
  • Constructor Details

    • Log4jPrintStream

      public Log4jPrintStream(org.apache.log4j.Logger log, org.apache.log4j.Level level) throws IllegalArgumentException
      Creates the Log4jPrintStream to flush to the given Category.
      Parameters:
      log - the Logger to write to
      level - the Level to use when writing to the Logger
      Throws:
      IllegalArgumentException - if cat == null or priority == null