pl.edu.agh.cast.util.logging
Class LoggingOutputStream
java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
pl.edu.agh.cast.util.logging.LoggingOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class LoggingOutputStream
- extends ByteArrayOutputStream
An output stream that writes contents to a Logger
upon each call to flush()
.
- Author:
- AGH CAST Team
Constructor Summary |
LoggingOutputStream(org.apache.log4j.Logger logger,
org.apache.log4j.Priority priority)
Constructor. |
Method Summary |
void |
flush()
Writes the existing contents of the output stream to the logger as a log record. |
LoggingOutputStream
public LoggingOutputStream(org.apache.log4j.Logger logger,
org.apache.log4j.Priority priority)
- Constructor.
- Parameters:
logger
- the logger to write topriority
- the priority at which to write the log message
flush
public void flush()
throws IOException
- Writes the existing contents of the output stream to the logger as a log record.
- Specified by:
flush
in interface Flushable
- Overrides:
flush
in class OutputStream
- Throws:
IOException
- See Also:
OutputStream.flush()
Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.