public class StdoutToLog4jFilter extends FilterWriter
Log targetLogger = LogFactory.getLog("org.hsqldb");
server.setLogWriter(new PrintWriter(new StdoutToLog4jFilter(server.getLogWriter(), targetLogger)));
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger
Log to log check logging level.
|
protected StringBuilder |
sb
string "buffer"
|
out
Constructor and Description |
---|
StdoutToLog4jFilter(Writer writer) |
StdoutToLog4jFilter(Writer writer,
org.apache.commons.logging.Log log) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
finalize() |
void |
flush() |
protected void |
log() |
protected void |
stripExtraNewLine() |
void |
write(char[] cbuf,
int off,
int len) |
void |
write(int c) |
void |
write(String str,
int off,
int len) |
protected org.apache.commons.logging.Log logger
protected StringBuilder sb
public StdoutToLog4jFilter(Writer writer)
public StdoutToLog4jFilter(Writer writer, org.apache.commons.logging.Log log)
public void write(int c) throws IOException
write
in class FilterWriter
IOException
public void write(char[] cbuf, int off, int len) throws IOException
write
in class FilterWriter
IOException
public void write(String str, int off, int len) throws IOException
write
in class FilterWriter
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class FilterWriter
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class FilterWriter
IOException
protected void finalize() throws Throwable
protected void log()
protected final void stripExtraNewLine()
Copyright © 2020. All rights reserved.