Package org.apache.logging.log4j.io
Class LoggerFilterWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.FilterWriter
-
- org.apache.logging.log4j.io.LoggerFilterWriter
-
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
public class LoggerFilterWriter extends FilterWriter
Logs each line written to a pre-defined level. Can also be configured with a Marker. This class provides an interface that follows theWriter
methods in spirit, but doesn't require output to any external out.- Since:
- 2.1
-
-
Field Summary
-
Fields inherited from class java.io.FilterWriter
out
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LoggerFilterWriter(Writer out, ExtendedLogger logger, String fqcn, Level level, Marker marker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
String
toString()
void
write(char[] cbuf)
void
write(char[] cbuf, int off, int len)
void
write(int c)
void
write(String str)
void
write(String str, int off, int len)
-
Methods inherited from class java.io.Writer
append, append, append, nullWriter
-
-
-
-
Constructor Detail
-
LoggerFilterWriter
protected LoggerFilterWriter(Writer out, ExtendedLogger logger, String fqcn, Level level, Marker marker)
-
-
Method Detail
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterWriter
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classFilterWriter
- Throws:
IOException
-
write
public void write(char[] cbuf) throws IOException
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
public void write(char[] cbuf, int off, int len) throws IOException
- Overrides:
write
in classFilterWriter
- Throws:
IOException
-
write
public void write(int c) throws IOException
- Overrides:
write
in classFilterWriter
- Throws:
IOException
-
write
public void write(String str) throws IOException
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
public void write(String str, int off, int len) throws IOException
- Overrides:
write
in classFilterWriter
- Throws:
IOException
-
-