public class LoggerPrintWriter extends PrintWriter
PrintWriter
methods in spirit, but doesn't require output to any external writer.
Integration with JDBC logging can be as simple as:
PrintWriter pw = IoBuilder.forLogger().setLevel(Level.DEBUG).buildPrintWriter(); DriverManager.setLogWriter(pw); DataSource ds = ... ds.setLogWriter(pw);
out
Modifier | Constructor and Description |
---|---|
protected |
LoggerPrintWriter(org.apache.logging.log4j.spi.ExtendedLogger logger,
boolean autoFlush,
String fqcn,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker) |
protected |
LoggerPrintWriter(Writer writer,
boolean autoFlush,
org.apache.logging.log4j.spi.ExtendedLogger logger,
String fqcn,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker) |
Modifier and Type | Method and Description |
---|---|
LoggerPrintWriter |
append(char c) |
LoggerPrintWriter |
append(CharSequence csq) |
LoggerPrintWriter |
append(CharSequence csq,
int start,
int end) |
boolean |
checkError() |
void |
close() |
void |
flush() |
LoggerPrintWriter |
format(Locale l,
String format,
Object... args) |
LoggerPrintWriter |
format(String format,
Object... args) |
void |
print(boolean b) |
void |
print(char c) |
void |
print(char[] s) |
void |
print(double d) |
void |
print(float f) |
void |
print(int i) |
void |
print(long l) |
void |
print(Object obj) |
void |
print(String s) |
LoggerPrintWriter |
printf(Locale l,
String format,
Object... args) |
LoggerPrintWriter |
printf(String format,
Object... args) |
void |
println() |
void |
println(boolean x) |
void |
println(char x) |
void |
println(char[] x) |
void |
println(double x) |
void |
println(float x) |
void |
println(int x) |
void |
println(long x) |
void |
println(Object x) |
void |
println(String x) |
String |
toString() |
void |
write(char[] buf) |
void |
write(char[] buf,
int off,
int len) |
void |
write(int c) |
void |
write(String s) |
void |
write(String s,
int off,
int len) |
clearError, setError
protected LoggerPrintWriter(org.apache.logging.log4j.spi.ExtendedLogger logger, boolean autoFlush, String fqcn, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker)
protected LoggerPrintWriter(Writer writer, boolean autoFlush, org.apache.logging.log4j.spi.ExtendedLogger logger, String fqcn, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker)
public LoggerPrintWriter append(char c)
append
in interface Appendable
append
in class PrintWriter
public LoggerPrintWriter append(CharSequence csq)
append
in interface Appendable
append
in class PrintWriter
public LoggerPrintWriter append(CharSequence csq, int start, int end)
append
in interface Appendable
append
in class PrintWriter
public boolean checkError()
checkError
in class PrintWriter
public void close()
close
in interface Closeable
close
in interface AutoCloseable
close
in class PrintWriter
public void flush()
flush
in interface Flushable
flush
in class PrintWriter
public LoggerPrintWriter format(Locale l, String format, Object... args)
format
in class PrintWriter
public LoggerPrintWriter format(String format, Object... args)
format
in class PrintWriter
public void print(boolean b)
print
in class PrintWriter
public void print(char c)
print
in class PrintWriter
public void print(char[] s)
print
in class PrintWriter
public void print(double d)
print
in class PrintWriter
public void print(float f)
print
in class PrintWriter
public void print(int i)
print
in class PrintWriter
public void print(long l)
print
in class PrintWriter
public void print(Object obj)
print
in class PrintWriter
public void print(String s)
print
in class PrintWriter
public LoggerPrintWriter printf(Locale l, String format, Object... args)
printf
in class PrintWriter
public LoggerPrintWriter printf(String format, Object... args)
printf
in class PrintWriter
public void println()
println
in class PrintWriter
public void println(boolean x)
println
in class PrintWriter
public void println(char x)
println
in class PrintWriter
public void println(char[] x)
println
in class PrintWriter
public void println(double x)
println
in class PrintWriter
public void println(float x)
println
in class PrintWriter
public void println(int x)
println
in class PrintWriter
public void println(long x)
println
in class PrintWriter
public void println(Object x)
println
in class PrintWriter
public void println(String x)
println
in class PrintWriter
public void write(char[] buf)
write
in class PrintWriter
public void write(char[] buf, int off, int len)
write
in class PrintWriter
public void write(int c)
write
in class PrintWriter
public void write(String s)
write
in class PrintWriter
public void write(String s, int off, int len)
write
in class PrintWriter
Copyright © 1999-2021 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.