Rio Project 4.2 API Documentation



org.rioproject.log
Class ServiceLogEventHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by org.rioproject.log.ServiceLogEventHandler
All Implemented Interfaces:
ServiceLogEventHandlerMBean

public class ServiceLogEventHandler
extends Handler
implements ServiceLogEventHandlerMBean

A @link java.util.logging.Handler} that publishes ServiceLogEvents to interested consumers when a LogRecord of interest is logged.

A LogRecord of interest is one that contains an exception.

The ServiceLogEventHandler will also publish ServiceLogEvents to interested consumers if the LogRecord has a level that is greater than or equal to the ServiceLogEventHandler's configured Level property (the default for this is Level.SEVERE), and whose name has been configured as a publishable logger. Matching semantics for a publishable logger name (as obtained from LogRecord.getLoggerName() starts with a configured publishable logger name.


Constructor Summary
ServiceLogEventHandler()
           
 
Method Summary
 boolean addPublishableLogger(String publishableLogger)
           
 void close()
           
 void flush()
           
 Collection<String> getPublishableLoggers()
           
 String getPublishOnLevel()
           
 EventProducer getSource()
           
 void publish(LogRecord logRecord)
           
 boolean removePublishableLogger(String publishableLogger)
           
 void setEventHandler(EventHandler eventHandler)
           
 void setPublishableLoggers(Collection<String> publishableLoggers)
           
 void setPublishOnLevel(Level level)
           
 void setPublishOnLevel(String level)
           
 void setSource(EventProducer source)
           
 
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

ServiceLogEventHandler

public ServiceLogEventHandler()
Method Detail

setEventHandler

public void setEventHandler(EventHandler eventHandler)

setSource

public void setSource(EventProducer source)

getSource

public EventProducer getSource()

setPublishOnLevel

public void setPublishOnLevel(String level)
Specified by:
setPublishOnLevel in interface ServiceLogEventHandlerMBean

setPublishOnLevel

public void setPublishOnLevel(Level level)

getPublishOnLevel

public String getPublishOnLevel()
Specified by:
getPublishOnLevel in interface ServiceLogEventHandlerMBean

addPublishableLogger

public boolean addPublishableLogger(String publishableLogger)
Specified by:
addPublishableLogger in interface ServiceLogEventHandlerMBean

removePublishableLogger

public boolean removePublishableLogger(String publishableLogger)
Specified by:
removePublishableLogger in interface ServiceLogEventHandlerMBean

setPublishableLoggers

public void setPublishableLoggers(Collection<String> publishableLoggers)

getPublishableLoggers

public Collection<String> getPublishableLoggers()
Specified by:
getPublishableLoggers in interface ServiceLogEventHandlerMBean

publish

public void publish(LogRecord logRecord)
Specified by:
publish in class Handler

flush

public void flush()
Specified by:
flush in class Handler

close

public void close()
Specified by:
close in class Handler

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.