org.jboss.logging.util
Class LoggerStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended byjava.io.PrintStream
              extended byorg.jboss.logging.util.LoggerStream

public class LoggerStream
extends java.io.PrintStream

A subclass of PrintStream that redirects its output to a log4j Logger.

This class is used to map PrintStream/PrintWriter oriented logging onto the log4j Categories. Examples include capturing System.out/System.err


Field Summary
static boolean TRACE
          Default flag to enable/disable tracing println calls.
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
LoggerStream(Logger logger)
          Redirect logging to the indicated logger using Level.INFO
LoggerStream(Logger logger, Level level, java.io.PrintStream ps)
          Redirect logging to the indicated logger using the given level.
 
Method Summary
 void println(java.lang.Object msg)
           
 void println(java.lang.String msg)
           
 void write(byte b)
           
 void write(byte[] b, int off, int len)
           
 
Methods inherited from class java.io.PrintStream
checkError, close, flush, print, print, print, print, print, print, print, print, print, println, println, println, println, println, println, println, println, setError, write
 
Methods inherited from class java.io.FilterOutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACE

public static final boolean TRACE
Default flag to enable/disable tracing println calls. from the system property org.jboss.logging.util.LoggerStream.trace or if not set defaults to false.

Constructor Detail

LoggerStream

public LoggerStream(Logger logger)
Redirect logging to the indicated logger using Level.INFO


LoggerStream

public LoggerStream(Logger logger,
                    Level level,
                    java.io.PrintStream ps)
Redirect logging to the indicated logger using the given level. The ps is simply passed to super but is not used.

Method Detail

println

public void println(java.lang.String msg)

println

public void println(java.lang.Object msg)

write

public void write(byte b)

write

public void write(byte[] b,
                  int off,
                  int len)