DESY ACOP Beans Home

com.cosylab.logging
Class ConsoleLogHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by com.cosylab.logging.ConsoleLogHandler

public class ConsoleLogHandler
extends java.util.logging.Handler

Implementation of Java Logging API handler.

Version:
$id$
Author:
Matej Sekoranja

Constructor Summary
ConsoleLogHandler()
          Default constructor.
ConsoleLogHandler(java.util.logging.Formatter formatter)
          Construct handler with using giver formatter.
 
Method Summary
 void close()
           
 void flush()
           
static void initializeConsoleLogging()
          Overrides default JVM logging configuration.
static void main(java.lang.String[] args)
          Simple test.
 void publish(java.util.logging.LogRecord record)
          Prints the log record to the console using the current formatter, if the log record is loggable.
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsoleLogHandler

public ConsoleLogHandler()
Default constructor.


ConsoleLogHandler

public ConsoleLogHandler(java.util.logging.Formatter formatter)
Construct handler with using giver formatter.

Parameters:
formatter - console log formatter, non-null.
Method Detail

close

public void close()
           throws java.lang.SecurityException
Specified by:
close in class java.util.logging.Handler
Throws:
java.lang.SecurityException
See Also:
Handler.close()

flush

public void flush()
Specified by:
flush in class java.util.logging.Handler
See Also:
Handler.flush()

publish

public void publish(java.util.logging.LogRecord record)
Prints the log record to the console using the current formatter, if the log record is loggable.

Specified by:
publish in class java.util.logging.Handler
Parameters:
record - the log record to publish
See Also:
Handler.publish(java.util.logging.LogRecord)

initializeConsoleLogging

public static void initializeConsoleLogging()
Overrides default JVM logging configuration. This is convenience method - there is no need for additional configuration file and system property.


main

public static void main(java.lang.String[] args)
Simple test.

Parameters:
args -


Copyright © 2010. All Rights Reserved.