Name

ConsoleHandler

Synopsis

This Handler subclass formats LogRecord objects and outputs the resulting string to the System.err output stream. When a ConsoleHandler is created, the various properties inherited from Handler are initialized using system-wide defaults obtained by querying named values with LogManager.getProperty( ). The table below lists these properties, the value passed to getProperty( ), and the default value used if getProperty( ) returns null. See Handler for further details.

Handler property

LogManager property name

Default

level

java.util.logging.ConsoleHandler.level

Level.INFO

filter

java.util.logging.ConsoleHandler.filter

null

formatter

java.util.logging.ConsoleHandler.formatter

SimpleFormatter

encoding

java.util.logging.ConsoleHandler.encoding

platform default

java.util.logging.ConsoleHandler

Figure 16-114. java.util.logging.ConsoleHandler

public class ConsoleHandler extends StreamHandler {
// Public Constructors
     public ConsoleHandler( );  
// Public Methods Overriding StreamHandler
     public void close( );  
     public void publish(LogRecord record);  
}

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.