org.csstudio.logging
Class JMSLogHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by org.csstudio.logging.JMSLogHandler

public class JMSLogHandler
extends java.util.logging.Handler

Log handler that sends messages to JMS

See JMSLogWriter for details on usage of Formatter.

Note that this handler needs an explicit start().

Author:
Kay Kasemir

Constructor Summary
JMSLogHandler(java.lang.String jms_url, java.lang.String topic)
          Initialize
 
Method Summary
 void close()
          
 void flush()
          
 void publish(java.util.logging.LogRecord record)
          
 void start()
          Start background thread that handles the JMS communication.
 
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

JMSLogHandler

public JMSLogHandler(java.lang.String jms_url,
                     java.lang.String topic)
Initialize

Parameters:
jms_url - JMS server URL
topic - JMS topic
Method Detail

start

public void start()
Start background thread that handles the JMS communication.

Throws:
java.lang.IllegalStateException - when already started

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