org.jcoderz.commons.logging
Class JmsHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by org.jcoderz.commons.logging.JmsHandler

public class JmsHandler
extends Handler

This log handler publishes log messages onto a jms queue. Information for the configuration has to be provided in the logging properties file. The following configuration can to be provided:
org.jcoderz.commons.logging.JmsHandler.factory:
Name of the jms connection factory, is mandatory.

org.jcoderz.commons.logging.JmsHandler.queue:
Name of the jms queue, is mandatory.

org.jcoderz.commons.logging.JmsHandler.filter:
Name of class implementing java.util.logging.Filter and which is to set as filter for this. If this is not specified, the default filter is used, which filters according to the symbol ids.

org.jcoderz.commons.logging.JmsHandler.messageids:
A comma or space separated list of message symbol ids for those messages, which are loggable for the default filter. The ids have either to be specified as integer values with base 10, or by prefixing with 0x as hex values.


Constructor Summary
JmsHandler()
          Creates a new instance of this and initialises resources.
 
Method Summary
 void close()
          
 void flush()
          
 void publish(LogRecord record)
          
 
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

JmsHandler

public JmsHandler()
           throws SecurityException,
                  NamingException,
                  InstantiationException,
                  IllegalAccessException,
                  ClassNotFoundException,
                  JMSException
Creates a new instance of this and initialises resources. It retrieves configuration parameters from the LogManagers and connects to the jms provider.

Throws:
SecurityException - If no permission to do the tasks.
NamingException - If the jms connection factory lookup fails.
InstantiationException - If not all required configuration parameters are specified.
IllegalAccessException - If illegal access to a class.
ClassNotFoundException - If a specified class name could not be found.
JMSException - If an error connecting to the JmsProvider occurs.
Method Detail

close

public void close()
           throws SecurityException

Specified by:
close in class Handler
Throws:
SecurityException

flush

public void flush()

Specified by:
flush in class Handler

publish

public void publish(LogRecord record)

Specified by:
publish in class Handler


Copyright 2007 The jCoderZ Project.