Top Description Fields Constructors Methods
org.jboss.logmanager.handlers

public Class OutputStreamHandler

extends WriterHandler
Class Inheritance
Known Direct Subclasses
org.jboss.logmanager.handlers.ConsoleHandler, org.jboss.logmanager.handlers.FileHandler
Imports
java.io.OutputStream, .OutputStreamWriter, .Writer, java.nio.charset.Charset, java.util.logging.ErrorManager, .Formatter, org.jboss.logmanager.formatters.Formatters

An output stream handler which supports any OutputStream, using the specified encoding. If no encoding is specified, the platform default is used.

Field Summary

Modifier and TypeField and Description
private OutputStream

Constructor Summary

AccessConstructor and Description
public
OutputStreamHandler()

Construct a new instance with no formatter.

public
OutputStreamHandler(final Formatter
the formatter to use
formatter
)

Construct a new instance.

public
OutputStreamHandler(final OutputStream
the output stream to use
outputStream
,
final Formatter
the formatter to use
formatter
)

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
private Writer
getNewWriter(OutputStream newOutputStream)

pack-priv OutputStream
protected void
setCharsetPrivate(Charset
the character set (must not be null)
charset
)

Overrides org.jboss.logmanager.ExtHandler.setCharsetPrivate.

Set the handler's character set from within this handler.

public void
setOutputStream(final OutputStream
the new output stream or null for none
outputStream
)

Set the output stream to write to.

public void
setWriter(final Writer
the new writer, or null to disable logging
writer
)

Overrides org.jboss.logmanager.handlers.WriterHandler.setWriter.

Set the writer.

Inherited from org.jboss.logmanager.handlers.WriterHandler:
closedoPublishflushgetWriterisCheckHeadEncodingisCheckTailEncodingpreWritesafeClosesafeFlushsetCheckHeadEncodingsetCheckTailEncoding

Field Detail

outputStreamback to summary
private OutputStream outputStream

Constructor Detail

OutputStreamHandlerback to summary
public OutputStreamHandler()

Construct a new instance with no formatter.

OutputStreamHandlerback to summary
public OutputStreamHandler(final Formatter formatter)

Construct a new instance.

Parameters
formatter:Formatter

the formatter to use

OutputStreamHandlerback to summary
public OutputStreamHandler(final OutputStream outputStream, final Formatter formatter)

Construct a new instance.

Parameters
outputStream:OutputStream

the output stream to use

formatter:Formatter

the formatter to use

Method Detail

getNewWriterback to summary
private Writer getNewWriter(OutputStream newOutputStream)
getOutputStreamback to summary
pack-priv OutputStream getOutputStream()
setCharsetPrivateback to summary
protected void setCharsetPrivate(Charset charset) throws SecurityException

Overrides org.jboss.logmanager.ExtHandler.setCharsetPrivate.

Doc from org.jboss.logmanager.ExtHandler.setCharsetPrivate.

Set the handler's character set from within this handler. If not set, the handler's character set is initialized to the platform default character set.

Parameters
charset:Charset

the character set (must not be null)

Annotations
@Override
setOutputStreamback to summary
public void setOutputStream(final OutputStream outputStream)

Set the output stream to write to. The output stream will then belong to this handler; when the handler is closed or a new writer or output stream is set, this output stream will be closed.

Parameters
outputStream:OutputStream

the new output stream or null for none

setWriterback to summary
public void setWriter(final Writer writer)

Overrides org.jboss.logmanager.handlers.WriterHandler.setWriter.

Doc from org.jboss.logmanager.handlers.WriterHandler.setWriter.

Set the writer. The writer will then belong to this handler; when the handler is closed or a new writer is set, this writer will be closed. Setting a writer will replace any target output stream.

Parameters
writer:Writer

the new writer, or null to disable logging