Class Log4jPrintStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.Appendable, java.lang.AutoCloseable

    public class Log4jPrintStream
    extends java.io.PrintStream
    A PrintStream that flushes out to a log4j Category.
    • Field Summary

      • Fields inherited from class java.io.FilterOutputStream

        out
    • Constructor Summary

      Constructors 
      Constructor Description
      Log4jPrintStream​(org.apache.log4j.Logger log, org.apache.log4j.Level level)
      Creates the Log4jPrintStream to flush to the given Category.
    • Method Summary

      • Methods inherited from class java.io.PrintStream

        append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write
      • Methods inherited from class java.io.FilterOutputStream

        write
      • Methods inherited from class java.io.OutputStream

        nullOutputStream
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Log4jPrintStream

        public Log4jPrintStream​(org.apache.log4j.Logger log,
                                org.apache.log4j.Level level)
                         throws java.lang.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:
        java.lang.IllegalArgumentException - if cat == null or priority == null