Syslog White Paper FAQ Examples JavaDoc Classloader
Protomatter Software v1.1.7

com.protomatter.syslog
Class JMSLog

java.lang.Object
  |
  +--com.protomatter.syslog.BasicLogger
        |
        +--com.protomatter.syslog.JMSLog
All Implemented Interfaces:
JMSConstants, Syslogger

public class JMSLog
extends BasicLogger
implements JMSConstants

A logger that writes messages to JMS. The JMS session used has no transaction attribute itself, so it will obey any JTS transaction context which is currently active.

The SyslogServer class can be used as a standalone JMS message receiver. Please see the JavaDoc for that class for more information.

See Also:
XML configuration class

Fields inherited from class com.protomatter.syslog.BasicLogger
formatter, policy, realPolicy
 
Fields inherited from interface com.protomatter.syslog.JMSConstants
JMS_PROP_CHANNEL, JMS_PROP_HOST, JMS_PROP_LEVEL, JMS_PROP_LOGGER, JMS_PROP_MESSAGE, JMS_PROP_MSG_TYPE, JMS_PROP_MSG_TYPE_VALUE, JMS_PROP_THREAD, JMS_PROP_TIME
 
Constructor Summary
JMSLog()
          You will need to call the configure() method if you use this constructor.
 
Method Summary
 void flush()
          Flush the given logger's output.
 java.lang.String getFactoryName()
          Get the JNDI name of the JMS connection factory we'll use.
 java.lang.String getPass()
          Get the password for authenticating to the JMS connection.
 boolean getPersistent()
          Get the message persistence flag.
 int getPriority()
          Get the message priority.
 java.lang.String getTopicName()
          Get the JNDI name of the JMS topic we'll publish to.
 int getTTL()
          Get the message TTL.
 java.lang.String getUser()
          Get the username for authenticating to the JMS connection.
 void log(SyslogMessage sm)
          Write a log message.
 void setFactoryName(java.lang.String factoryName)
          Set the JNDI name of the JMS connection factory we'll use.
 void setPass(java.lang.String pass)
          Set the password for authenticating to the JMS connection.
 void setPersistent(boolean persistent)
          Set the message persistence flag.
 void setPriority(int priority)
          Set the message priority.
 void setTopicName(java.lang.String topicName)
          Set the JNDI name of the JMS topic we'll publish to.
 void setTTL(int ttl)
          Get the message TTL.
 void setUser(java.lang.String user)
          Set the username for authenticating to the JMS connection.
 void shutdown()
          Prepare for shutdown.
 void start()
           
 
Methods inherited from class com.protomatter.syslog.BasicLogger
formatLogEntry, getName, getPolicy, getTextFormatter, isSuspended, mightLog, resetDateFormat, resume, setName, setPolicy, setTextFormatter, shouldLog, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMSLog

public JMSLog()
You will need to call the configure() method if you use this constructor.
Method Detail

getPriority

public int getPriority()
Get the message priority.

setPriority

public void setPriority(int priority)
Set the message priority. Default is 5.

getTTL

public int getTTL()
Get the message TTL.

setTTL

public void setTTL(int ttl)
Get the message TTL. Default is 30 minutes.

getPersistent

public boolean getPersistent()
Get the message persistence flag.

setPersistent

public void setPersistent(boolean persistent)
Set the message persistence flag. Default is false.

getTopicName

public java.lang.String getTopicName()
Get the JNDI name of the JMS topic we'll publish to.

setTopicName

public void setTopicName(java.lang.String topicName)
Set the JNDI name of the JMS topic we'll publish to.

getFactoryName

public java.lang.String getFactoryName()
Get the JNDI name of the JMS connection factory we'll use.

setFactoryName

public void setFactoryName(java.lang.String factoryName)
Set the JNDI name of the JMS connection factory we'll use.

getUser

public java.lang.String getUser()
Get the username for authenticating to the JMS connection. THIS IS NOT THE JNDI CREDENTIALS.

setUser

public void setUser(java.lang.String user)
Set the username for authenticating to the JMS connection. THIS IS NOT THE JNDI CREDENTIALS.

getPass

public java.lang.String getPass()
Get the password for authenticating to the JMS connection. THIS IS NOT THE JNDI CREDENTIALS.

setPass

public void setPass(java.lang.String pass)
Set the password for authenticating to the JMS connection. THIS IS NOT THE JNDI CREDENTIALS.

log

public final void log(SyslogMessage sm)
Write a log message. A javax.jms.TextMessage is created. The text of the message is set to the detail formatting output from text formatter configured for this logger.

Message properties are set as follows:

name type value
JMS_PROP_HOST ("host") String Originating host IP address.
JMS_PROP_TIME ("time") Long Time the message was sent.
JMS_PROP_CHANNEL ("channel") String Channel name.
JMS_PROP_LOGGER ("logger") String Full class name of the logger.
JMS_PROP_MESSAGE ("message") String Short message.
JMS_PROP_LEVEL ("level") Integer Severity level.
JMS_PROP_THREAD ("thread") String Originating thread's getName() value.


shutdown

public void shutdown()
Prepare for shutdown.

start

public void start()

flush

public void flush()
Description copied from interface: Syslogger
Flush the given logger's output.

Protomatter Software v1.1.7
Copyright 1998-2002 Nate Sammons

Protomatter Software v1.1.7 http://protomatter.sourceforge.net/1.1.7