Package org.apache.logging.log4j.io
Class LoggerInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.apache.logging.log4j.io.LoggerInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class LoggerInputStream extends FilterInputStream
Logs each line read to a pre-defined level. Can also be configured with a Marker.- Since:
- 2.1
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LoggerInputStream(InputStream in, Charset charset, ExtendedLogger logger, String fqcn, Level level, Marker marker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
String
toString()
-
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
LoggerInputStream
protected LoggerInputStream(InputStream in, Charset charset, 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 classFilterInputStream
- Throws:
IOException
-
read
public int read() throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
-