Package nl.vpro.logging
Class AbstractLoggerOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- nl.vpro.logging.AbstractLoggerOutputStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
- Direct Known Subclasses:
Log4j2OutputStream
,LoggerOutputStream
,SimpleLoggerOutputStream
public abstract class AbstractLoggerOutputStream extends OutputStream
Wraps some logger in anOutputStream
, making logging available as an outputstream, which can be useful for things that accept outputstreams (e.g. external processes)- Author:
- Michiel Meeuwissen
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractLoggerOutputStream(boolean skipEmptyLines, Integer max)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
Charset
getCharset()
long
getCount()
Integer
getMax()
protected abstract void
log(String line)
void
setCharset(Charset charset)
void
setMax(Integer max)
void
write(int b)
-
Methods inherited from class java.io.OutputStream
nullOutputStream, write, write
-
-
-
-
Constructor Detail
-
AbstractLoggerOutputStream
protected AbstractLoggerOutputStream(boolean skipEmptyLines, Integer max)
-
-
Method Detail
-
log
protected abstract void log(String line)
-
write
public void write(int b)
- Specified by:
write
in classOutputStream
-
flush
public void flush()
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
getCount
public long getCount()
-
getMax
public Integer getMax()
-
setMax
public void setMax(Integer max)
-
getCharset
public Charset getCharset()
-
setCharset
public void setCharset(Charset charset)
-
-