org.objectweb.util.monolog.wrapper.javaLog
Class ConsoleHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by org.objectweb.util.monolog.wrapper.javaLog.ConsoleHandler

public class ConsoleHandler
extends java.util.logging.Handler

The aim of this class is to permit to specify the output for the console handler of the java.util.logging system. This console handler is also able to choose the right ouput (System.err or System.out) depending on the message level.

Author:
S.Chassande-Barrioz

Field Summary
protected  OutputStreamSwitcher oss
           
 
Constructor Summary
ConsoleHandler()
           
 
Method Summary
 void activateSwitching()
           
 void close()
           
 void desactivateSwitching(java.io.OutputStream newOut)
           
 void flush()
           
 void publish(java.util.logging.LogRecord record)
           
 void setOutput(java.io.OutputStream out)
          Assign the Outputstream by calling a protected method from the super class.
 
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
 

Field Detail

oss

protected OutputStreamSwitcher oss
Constructor Detail

ConsoleHandler

public ConsoleHandler()
Method Detail

desactivateSwitching

public void desactivateSwitching(java.io.OutputStream newOut)

activateSwitching

public void activateSwitching()

setOutput

public void setOutput(java.io.OutputStream out)
               throws java.lang.SecurityException
Assign the Outputstream by calling a protected method from the super class.

Throws:
java.lang.SecurityException

publish

public void publish(java.util.logging.LogRecord record)
Specified by:
publish in class java.util.logging.Handler

flush

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

close

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