org.jboss.logging.util
Class LoggerStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.PrintStream
org.jboss.logging.util.LoggerStream
- All Implemented Interfaces:
- Closeable, Flushable, Appendable
public class LoggerStream
- extends 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
- Version:
- $Revision: 1.3.6.1 $
- Author:
- Scott Stark., Jason Dillon
Field Summary |
static boolean |
TRACE
Default flag to enable/disable tracing println calls. |
Constructor Summary |
LoggerStream(org.apache.log4j.Logger logger)
Redirect logging to the indicated logger using Level.INFO |
LoggerStream(org.apache.log4j.Logger logger,
org.apache.log4j.Level level,
PrintStream ps)
Redirect logging to the indicated logger using the given
level. |
Methods inherited from class java.io.PrintStream |
append, append, append, checkError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, setError, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
LoggerStream
public LoggerStream(org.apache.log4j.Logger logger)
- Redirect logging to the indicated logger using Level.INFO
LoggerStream
public LoggerStream(org.apache.log4j.Logger logger,
org.apache.log4j.Level level,
PrintStream ps)
- Redirect logging to the indicated logger using the given
level. The ps is simply passed to super but is not used.
println
public void println(String msg)
- Overrides:
println
in class PrintStream
println
public void println(Object msg)
- Overrides:
println
in class PrintStream
write
public void write(byte b)
write
public void write(byte[] b,
int off,
int len)
- Overrides:
write
in class PrintStream
Copyright © 2002 JBoss Group, LLC. All Rights Reserved.