|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.protomatter.syslog.SyslogServer
A standalone log processing server which either reads messages from a JMS topic, or through RMI. Reads configuration information from a properties file, given as the first command-line argument. System properties will override ones given in the properties file.
Basic properties are:
name | value |
Syslog.config.xml | Path to a syslog configuration XML file. Messages are pulled off of JMS and sent into the "local" Syslog instance for processing according to this configuration file. |
If the server will listen to a JMS topic for messages, the following properties are used:
name | value |
jms.topic | The JNDI name of the JMS topic to listen to. |
jms.connection.user | A location in JNDI where an instance of javax.jms.TopicConnectionFactory can be found. |
jms.connection.pass | Optional. The password to use when creating the JMS connection. This is not the JNDI credentials. |
jms.connection.factory | The JNDI location of a JMS connection factory to use. |
jms.message.selector | Optional. A JMS message selector for choosing messages that this server will receive. |
If the server will bind a log receiver callback object into JNDI on an application server, the following properties are used:
name | value |
jndi.name | The location in JNDI to bind the receiver object at. The string "com.protomatter.syslog.remote." is prepended to this value. The value should not contain the "." character. |
receiver.class | Optional. The full classname of an
object that implements the
RemoteLogReceiver interface.
The object must have a default (no-argument)
constructor. The default value for this
property is
com.protomatter.syslog.RemoteLogReceiverImpl .
|
The properties file is also used when creating the JNDI context (it is passed to the constructor for javax.naming.InitialContext), so the following properties are also needed, and are specific to the JNDI provider you're using (WebLogic, etc):
name | value |
java.naming.factory.initial | The JNDI provider factory to use. For instance, with BEA WebLogic, this should be set to "weblogic.jndi.WLInitialContextFactory". |
java.naming.provider.url | The JNDI provider URL. With BEA WebLogic, this should be set to something like "t3://hostname:port". |
See the JavaDoc for javax.naming.Context for more information on JNDI connection properties.
Here's an example that works with BEA WebLogic Server. First, configure a JMS connection factory and a topic in WLS. Add the following to your weblogic.properties file:
## The JMS topic weblogic.jms.topic.syslogTopic=\ javax.jms.topic.Syslog ## The JMS connection factory weblogic.jms.connectionFactoryName.syslogTopicFactory=\ javax.jms.connection.syslog ## The Syslog startup class for WLS weblogic.system.startupClass.syslog=\ com.protomatter.syslog.SyslogT3Startup ## The configuration file for Syslog. java.system.property.Syslog.config.xml=\ /opt/weblogic/weblogic-syslog.xml |
Now, configure the syslog instance that runs in WLS. This file is referenced above in the weblogic.properties file as /opt/weblogic/weblogic-syslog.xml. This configuration includes a JMS logger and a logger that writes to System.out.
<Syslog defaultMask="DEBUG"> <Logger name="out" class="com.protomatter.syslog.PrintWriterLog"> <stream>System.out</stream> </Logger> <Logger name="jms" class="com.protomatter.syslog.JMSLog"> <factoryName>javax.jms.connection.syslog</factoryName> <topicName>javax.jms.topic.Syslog</topicName> </Logger> </Syslog> |
Next, configure the Syslog instance that will run inside the remote log server. This is a simple configuration that just prints things out to System.out. We'll refer to this file as /home/nate/syslog.xml.
<Syslog defaultMask="DEBUG"> <Logger name="out" class="com.protomatter.syslog.PrintWriterLog"> <stream>System.out</stream> </Logger> </Syslog> |
Next, we need a configuration file for the remote log server.
Syslog.config.xml=/home/nate/syslog.xml ## The JNDI connection factory to use java.naming.factory.initial=\ weblogic.jndi.WLInitialContextFactory ## The JNDI URL of the server to connect to java.naming.provider.url=\ t3://hostname:port ## The JMS factory location in JNDI jms.connection.factory=\ javax.jms.connection.syslog ## The JMS topic name in JNDI jms.topic=javax.jms.topic.Syslog |
Now, pass this properties file to the SyslogServer program as its only command-line argument. It should come up, connect to the server and start sucking messages off of JMS.
JMSLog
,
RemoteLog
Method Summary | |
static void |
main(java.lang.String[] args)
Start the syslog log server. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static final void main(java.lang.String[] args)
|
Protomatter Classes v1.1.6 Copyright 1998-2001 Nate Sammons |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Protomatter Classes v1.1.6 | http://protomatter.sourceforge.net/1.1.6 |