com.protomatter.syslog |
Syslog is a system-wide logging facility. It's roughly based on the
UNIX syslog facility, but has many nice features not found there.
It provides a clean, uniform interface for sending log messages and
a modular back-end for writing entries to files, databases, etc.
The main class that other programs interact with is the
{@link com.protomatter.syslog.Syslog Syslog} class.
Everything on the class is static, making
it easy to interact with as a service. The
{@link com.protomatter.syslog.Channel Channel} class
is a simplified, "federated namespace" interface for sending
messages.
Messages sent to Syslog are handled by objects implementing the
Syslogger interface. Syslog provides the concept of
levels (DEBUG, INFO, WARNING, ERROR and FATAL). Individual loggers
can have their own log policies for deciding if they should
pay attention to given log message. There is a useful default
policy that allows loggers to only listen to certain channels or
messages at certain levels, etc.
Syslog provides startup classes for both the
BEA WebLogic Server
Application Server, and for Protomatter's own PAS Application Server.
This allows for easy configuration of the Syslog package
when each application server starts.
Please refer to the Syslog Whitepaper
the JavaDoc for the {@link com.protomatter.syslog.Syslog Syslog}
class for more information on usage.
For information on configuring Syslog via an XML file, please refer
to JavaDoc for the
{@link com.protomatter.syslog.xml.SyslogXML SyslogXML} class.
Every error message can displayed in
a different language. Simply add a new resource
(named com/protomatter/syslog/Syslog) to your classpath
for the new language. For instance, to add French error
messages, you would copy the existing file
com/protomatter/syslog/Syslog.properties
and make a new file called
com/protomatter/syslog/Syslog_fr.properties
and place it in the CLASSPATH. Please see the
JavaDoc for the java.util.ResourceBundle class
for more information.
|
Java Source File Name | Type | Comment |
AsciiStreamDatabaseLogStatementAdapter.java | Class | A log adapter that uses the setAsciiStream() method to
set details. |
BasicLogger.java | Class | A base class for Syslogger implementations.
This class provides common functions for setting
the date format for log entries and for formatting dates.
The default policy used by this logger is the
SimpleLogPolicy SimpleLogPolicy policy. |
Channel.java | Class | A utility class for writing log messages to channels.
Example usage of this class is as follows:
// get the channel object
Channel myChannel = Channel.getChannel("MY CHANNEL");
myChannel.info(this, "Hello there");
// get the default chanel object
Channel default = Channel.getDefaultChannel();
default.info(this, "Hello there");
// You can also write to multiple channels
String channels[] = new String[] { "first-channel", "second-channel" };
Channel lotsaChannels = Channel.getChannel(channels);
lotsChannels.info(this, "Hello there");
// And finally, you can delegate the list of channels to
// an object that implements the SyslogChannelAware interface
SyslogChannelAware channelAware = new MyChannelAwareObject();
Channel delegatedChannel = Channel.getChannel(channelAware);
delegatedChannel.info(this, "Hello there");
|
Basically, rather than using the infoToChannel(...)
method and others on Syslog, you can simply get a
handle to a channel and call methods on it. |
CharacterStreamDatabaseLogStatementAdapter.java | Class | A log adapter that uses the setCharacterStream() method to
set details. |
DatabaseLog.java | Class | A logger that writes to a database. |
DatabaseLogStatementAdapter.java | Interface | An adapter for setting the message detail in the database log. |
FalseLogPolicy.java | Class | A log policy that always returns false. |
FileLog.java | Class | A logger that simply writes to a file. |
HTMLSyslogTextFormatter.java | Class | A log entry formatter that produces HTML. |
JDK14PerChannelPolicy.java | Class | A policy that can make decision on a per-channel basis.
It maintains a default log mask and channel list
itself, but also has a list of "policy groups" that
each have a log mask and channel list of their own
in addition to a list of channel names that their
mask and channel list applies to. |
JDK14PerClassPolicy.java | Class | A policy that can make decision on a per-class basis.
It maintains a default log mask and channel list
itself, but also has a list of "policy groups" that
each have a log mask and channel list of their own
in addition to a list of class names that their
mask and channel list applies to. |
JMSConstants.java | Interface | Constants for JMS-related Syslog functions. |
JMSLog.java | Class | 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 SyslogServer class can be used as
a standalone JMS message receiver. |
LengthRolloverLog.java | Class | An implementation of an object that will log things using the Syslog
facility, and roll it's log files after a certain number of bytes
have been written to them. |
LogPolicy.java | Interface | The interface for the pluggable log policy system. |
MailException.java | Class | An exception dealing with SMTP mail. |
MailLog.java | Class | A logger that sends email. |
MailMessage.java | Class | A simple mail message object. |
MessageConstants.java | Class | Constants for messages loaded from resource bundles. |
OpenFileLog.java | Class | A logger that opens the file for each log entry and closes it
after it's done writing. |
PerChannelPolicy.java | Class | A policy that can make decision on a per-channel basis.
It maintains a default log mask and channel list
itself, but also has a list of "policy groups" that
each have a log mask and channel list of their own
in addition to a list of channel names that their
mask and channel list applies to. |
PerClassPolicy.java | Class | A policy that can make decision on a per-class basis.
It maintains a default log mask and channel list
itself, but also has a list of "policy groups" that
each have a log mask and channel list of their own
in addition to a list of class names that their
mask and channel list applies to. |
PerformanceTest.java | Class | A performance testing rig for Syslog. |
PrintWriterLog.java | Class | An implementation of an object that will log things
using the Syslog facility. |
RemoteLog.java | Class | A logger that sends messages to remote receivers
bound in JNDI.
Object bound directly under the
"com.protomatter.syslog.remote" location
in JNDI will receive the log message if they
implement the
RemoteLogReceiver RemoteLogReceiver interface.
When calling methods on the remote objects, they
are first run through PortableRemoteObject.narrow()
to ensure everything is OK. |
RemoteLogReceiver.java | Interface | An interface for loggers that are receiving messages from
a remote machine via RMI. |
RemoteLogReceiverImpl.java | Class | A simple implementation of the RemoteLogReceiver
interface. |
SimpleLogPolicy.java | Class | The default LogPolicy that knows about log levels and channels. |
SimpleSyslogMailSubjectFormatter.java | Class | A simple mail subject formatter. |
SimpleSyslogTextFormatter.java | Class | A simple log entry formatter. |
SMTPMailTransport.java | Class | A simple class that talks SMTP to servers. |
StringDatabaseLogStatementAdapter.java | Class | A log adapter that uses the setString() method to
set details. |
Syslog.java | Class | This class implements a system-wide logging utility. |
SyslogChannelAware.java | Interface | An interface for objects that are aware of channels in
syslog. |
Syslogger.java | Interface | An interface for objects that will log things using the Syslog facility. |
SyslogHandler.java | Class | A JDK 1.4 logging system handler to route messages
into Syslog. |
SyslogHTMLMailFormatter.java | Class | A simple HTML log entry formatter for email. |
SyslogInitException.java | Class | An exception during the syslog init process. |
SyslogMailSubjectFormatter.java | Interface | The interface for the pluggable message subject formatting
system. |
SyslogMessage.java | Class | A utility class representing all the information needed
to make a syslog call. |
SyslogServer.java | Class | 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. | SyslogT3Startup.java | Class | Configure syslog to start when WebLogic does. | SyslogTextFormatter.java | Interface | The interface for the pluggable text formatting system. | SyslogWriter.java | Class | A Writer that is attached to Syslog. | TimeRolloverLog.java | Class | A logger that will roll files when the minute, hour, day, week or
month change. | UNIXSyslogLog.java | Class | A logger that sends UDP packets to a UNIX syslog server.
This logger sends UDP packets to UNIX servers running a BSD-style
syslogd daemon. | Wl6SyslogTextFormatter.java | Class | A log formatter that mimics the log output from WebLogic Server 6.x. | WlSyslogTextFormatter.java | Class | A log formatter that mimics the log output from WebLogic. |
|