public class StreamHandler extends Handler
Known Direct Subclasses

Stream based logging Handler.

This is primarily intended as a base class or support class to be used in implementing other logging Handlers.

LogRecords are published to a given

Configuration: By default each StreamHandler is initialized using the following LogManager configuration properties. If properties are not defined (or have invalid values) then the specified default values are used.

  • java.util.logging.StreamHandler.level specifies the default level for the Handler (defaults to Level.INFO).
  • java.util.logging.StreamHandler.filter specifies the name of a Filter class to use (defaults to no Filter).
  • java.util.logging.StreamHandler.formatter specifies the name of a Formatter class to use (defaults to java.util.logging.SimpleFormatter).
  • java.util.logging.StreamHandler.encoding the name of the character set encoding to use (defaults to the default platform encoding).

Public Constructor Summary

Create a StreamHandler, with no current output stream.
StreamHandler(OutputStream out, Formatter formatter)
Create a StreamHandler with a given Formatter and output stream.

Public Method Summary

synchronized void
Close the current output stream.
synchronized void
Flush any buffered messages.
isLoggable(LogRecord record)
Check if this Handler would actually log a given LogRecord.
synchronized void
publish(LogRecord record)
Format and publish a LogRecord.
setEncoding(String encoding)
Set (or change) the character encoding used by this Handler.

Protected Method Summary

synchronized void
setOutputStream(OutputStream out)
Change the output stream.

Inherited Method Summary

Public Constructors

public StreamHandler ()