Class LogEventOutputStream
java.lang.Object
java.io.OutputStream
org.jpos.util.LogEventOutputStream
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable, Runnable, LogSource
OutputStream that buffers writes and periodically flushes the
accumulated bytes as a single LogEvent after a configurable delay.-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.LogEventOutputStream(Logger logger, String realm, long delay) Constructs a stream that flushes the buffered bytes as log events on the configured logger/realm afterdelayms of inactivity. -
Method Summary
Methods inherited from class OutputStream
flush, nullOutputStream, write, write
-
Constructor Details
-
LogEventOutputStream
public LogEventOutputStream()Default constructor. -
LogEventOutputStream
Constructs a stream that flushes the buffered bytes as log events on the configured logger/realm afterdelayms of inactivity.- Parameters:
logger- destination loggerrealm- logger realmdelay- flush delay in milliseconds
-
-
Method Details
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
setLogger
-
getRealm
-
getLogger
-
run
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-