com.sun.common.util.logging
Class LoggingOutputStream
java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
com.sun.common.util.logging.LoggingOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class LoggingOutputStream
- extends ByteArrayOutputStream
Implementation of a OutputStream that flush the records to a Logger.
This is useful to redirect stderr and stdout to loggers.
User: Jerome Dochez
author: Jerome Dochez, Carla Mott
|
Method Summary |
void |
flush()
upon flush() write the existing contents of the OutputStream
to the logger as a log record. |
LoggingOutputStream
public LoggingOutputStream(Logger logger,
Level level)
- Constructor
- Parameters:
logger - Logger to write tolevel - Level at which to write the log message
flush
public void flush()
throws IOException
- upon flush() write the existing contents of the OutputStream
to the logger as a log record.
- Specified by:
flush in interface Flushable- Overrides:
flush in class OutputStream
- Throws:
IOException - in case of error
Copyright © 2012 GlassFish Community. All Rights Reserved.