public class LoggerStream extends PrintStream
This class is used to map PrintStream/PrintWriter oriented logging onto the log4j Categories. Examples include capturing System.out/System.err
Modifier and Type | Field and Description |
---|---|
static boolean |
TRACE
Default flag to enable/disable tracing println calls.
|
out
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
println(Object msg) |
void |
println(String msg) |
void |
write(byte b) |
void |
write(byte[] b,
int off,
int len) |
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, setError, write
write
public static final boolean TRACE
public LoggerStream(org.apache.log4j.Logger logger)
logger
- the loggerpublic LoggerStream(org.apache.log4j.Logger logger, org.apache.log4j.Level level, PrintStream ps)
logger
- the loggerlevel
- the levelps
- the streampublic void println(String msg)
println
in class PrintStream
public void println(Object msg)
println
in class PrintStream
public void write(byte b)
public void write(byte[] b, int off, int len)
write
in class PrintStream
Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.