APIdia Launch Partner
Top Description Constructors Methods
java.util.logging

public Class ConsoleHandler

extends StreamHandler
Class Inheritance

This Handler publishes log records to System.err. By default the SimpleFormatter is used to generate brief summaries.

Configuration: By default each ConsoleHandler is initialized using the following LogManager configuration properties where <handler-name> refers to the fully-qualified class name of the handler. If properties are not defined (or have invalid values) then the specified default values are used.

For example, the properties for ConsoleHandler would be:

For a custom handler, e.g. com.foo.MyHandler, the properties would be:

Since
1.4

Constructor Summary

AccessConstructor and Description
public
ConsoleHandler()

Create a ConsoleHandler for System.err.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.util.logging.StreamHandler.close.

Override StreamHandler.close to do a flush but not to close the output stream.

public void
publish(LogRecord
description of the log event. A null record is silently ignored and is not published
record
)

Overrides java.util.logging.StreamHandler.publish.

Publish a LogRecord.

Inherited from java.util.logging.StreamHandler:
flushisLoggablesetEncodingsetOutputStreamsynchronousPostWriteHook

Constructor Detail

ConsoleHandlerback to summary
public ConsoleHandler()

Create a ConsoleHandler for System.err.

The ConsoleHandler is configured based on LogManager properties (or their default values).

Method Detail

closeback to summary
public void close()

Overrides java.util.logging.StreamHandler.close.

Override StreamHandler.close to do a flush but not to close the output stream. That is, we do not close System.err.

Annotations
@Override
publishback to summary
public void publish(LogRecord record)

Overrides java.util.logging.StreamHandler.publish.

Publish a LogRecord.

The logging request was made initially to a Logger object, which initialized the LogRecord and forwarded it here.

Implementation Specification

This method is not synchronized, and subclasses must not define overridden publish() methods to be synchronized if they call super.publish() or format user arguments. See the discussion in java.util.logging.Handler for more information.

Parameters
record:LogRecord

description of the log event. A null record is silently ignored and is not published

Annotations
@Override