java.util.logging
Class ConsoleHandler

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.util.logging.Handler sample code for java.util.logging.Handler definition code for java.util.logging.Handler 
      extended by java.util.logging.StreamHandler sample code for java.util.logging.StreamHandler definition code for java.util.logging.StreamHandler 
          extended by java.util.logging.ConsoleHandler

public class ConsoleHandler
extends StreamHandler sample code for java.util.logging.StreamHandler definition code for java.util.logging.StreamHandler

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. If properties are not defined (or have invalid values) then the specified default values are used.

Since:
1.4

Constructor Summary
ConsoleHandler sample code for java.util.logging.ConsoleHandler.ConsoleHandler() definition code for java.util.logging.ConsoleHandler.ConsoleHandler() ()
          Create a ConsoleHandler for System.err.
 
Method Summary
 void close sample code for java.util.logging.ConsoleHandler.close() definition code for java.util.logging.ConsoleHandler.close() ()
          Override StreamHandler.close to do a flush but not to close the output stream.
 void publish sample code for java.util.logging.ConsoleHandler.publish(java.util.logging.LogRecord) definition code for java.util.logging.ConsoleHandler.publish(java.util.logging.LogRecord) (LogRecord sample code for java.util.logging.LogRecord definition code for java.util.logging.LogRecord  record)
          Publish a LogRecord.
 
Methods inherited from class java.util.logging.StreamHandler sample code for java.util.logging.StreamHandler definition code for java.util.logging.StreamHandler
flush sample code for java.util.logging.StreamHandler.flush() definition code for java.util.logging.StreamHandler.flush() , isLoggable sample code for java.util.logging.StreamHandler.isLoggable(java.util.logging.LogRecord) definition code for java.util.logging.StreamHandler.isLoggable(java.util.logging.LogRecord) , setEncoding sample code for java.util.logging.StreamHandler.setEncoding(java.lang.String) definition code for java.util.logging.StreamHandler.setEncoding(java.lang.String) , setOutputStream sample code for java.util.logging.StreamHandler.setOutputStream(java.io.OutputStream) definition code for java.util.logging.StreamHandler.setOutputStream(java.io.OutputStream)
 
Methods inherited from class java.util.logging.Handler sample code for java.util.logging.Handler definition code for java.util.logging.Handler
getEncoding sample code for java.util.logging.Handler.getEncoding() definition code for java.util.logging.Handler.getEncoding() , getErrorManager sample code for java.util.logging.Handler.getErrorManager() definition code for java.util.logging.Handler.getErrorManager() , getFilter sample code for java.util.logging.Handler.getFilter() definition code for java.util.logging.Handler.getFilter() , getFormatter sample code for java.util.logging.Handler.getFormatter() definition code for java.util.logging.Handler.getFormatter() , getLevel sample code for java.util.logging.Handler.getLevel() definition code for java.util.logging.Handler.getLevel() , reportError sample code for java.util.logging.Handler.reportError(java.lang.String, java.lang.Exception, int) definition code for java.util.logging.Handler.reportError(java.lang.String, java.lang.Exception, int) , setErrorManager sample code for java.util.logging.Handler.setErrorManager(java.util.logging.ErrorManager) definition code for java.util.logging.Handler.setErrorManager(java.util.logging.ErrorManager) , setFilter sample code for java.util.logging.Handler.setFilter(java.util.logging.Filter) definition code for java.util.logging.Handler.setFilter(java.util.logging.Filter) , setFormatter sample code for java.util.logging.Handler.setFormatter(java.util.logging.Formatter) definition code for java.util.logging.Handler.setFormatter(java.util.logging.Formatter) , setLevel sample code for java.util.logging.Handler.setLevel(java.util.logging.Level) definition code for java.util.logging.Handler.setLevel(java.util.logging.Level)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

ConsoleHandler sample code for java.util.logging.ConsoleHandler() definition code for java.util.logging.ConsoleHandler()

public ConsoleHandler()
Create a ConsoleHandler for System.err.

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

Method Detail

publish sample code for java.util.logging.ConsoleHandler.publish(java.util.logging.LogRecord) definition code for java.util.logging.ConsoleHandler.publish(java.util.logging.LogRecord)

public void publish(LogRecord sample code for java.util.logging.LogRecord definition code for java.util.logging.LogRecord  record)
Publish a LogRecord.

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

Overrides:
publish sample code for java.util.logging.StreamHandler.publish(java.util.logging.LogRecord) definition code for java.util.logging.StreamHandler.publish(java.util.logging.LogRecord) in class StreamHandler sample code for java.util.logging.StreamHandler definition code for java.util.logging.StreamHandler
Parameters:
record - description of the log event. A null record is silently ignored and is not published

close sample code for java.util.logging.ConsoleHandler.close() definition code for java.util.logging.ConsoleHandler.close()

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

Overrides:
close sample code for java.util.logging.StreamHandler.close() definition code for java.util.logging.StreamHandler.close() in class StreamHandler sample code for java.util.logging.StreamHandler definition code for java.util.logging.StreamHandler