grace.log
Class Log

java.lang.Object
  |
  +--grace.log.Log

public class Log
extends java.lang.Object
implements Distributer

This implements a logging facility to allow the user to log programmatic context and data to various log devices such as System.out, a file, a GUI, etc. Each entry in the log is called an event. An event captures various data items such as the time, an event type, the program's position, a message, an object, or a Java Exception. The different event types handled by this logging facility are:

Errors are problems that have been detected in the code that are not accompanied by an exception, or exceptions that have occurred and the program has interpreted the exception and has translated it to a higher level error message, or exceptions that have occurred that the programmer does not know how to handle. Errors should be situations where the program is confident that if the problem is not solved, the program may not continue to run. The programmer may indicate an error message as follows:

	if (dog == null) Log.error("Unexpected null dog");
 
or,
	try { dog.bark(); }
	catch (SickDogException e) { Log.error(e); }
 

The programmer may also indicate an object as part of the notification, as follows:

	dog.bark();
	if (!dog.isBarking()) Log.error("dog won't bark", dog);
 

Warnings are similar to errors but do not have the same level of severity. They indicate a problem in the system but one that will not affect the immediate health of the program.

 	if (!dog.isBarking()) {
	    dog.bark();
	    Log.warning("dog wasn't barking but now he is");
 

Notices are events that the programmer would like to be logged but that are not warnings or errors and are merely for informational purposes only.

 	dog = new Dog();
	Log.notice("created new dog");
 

Traces are events used for debugging. They can be eliminated at run time by filtering. Like all other events types, the trace facility fills in the current function and line number in the code so the caller should not provide this in his message.

	Log.trace("current dog", dog);
 

User Defined are events in which the programmer can specify his own event type. There is no difference between the programmer defined types and the defined ones (errors, warnings, notices, traces).

	Log.log("statistics", "number-of-dogs=" + numDogs);
 

Handlers

The Log class merely acts as a distributer of events to Handlers. Handlers are objects that handle and, presumably, output in some way one or more event types. There can be many Handlers installed in a running program. For example, one Handler can be saving every logged event to a file while another Handler can be displaying a popup dialog only when an error occurs.

Currently, there are only four handlers:

To install a custom handler, one must derive from grace.log.Handler and install an instance of the Handler using the addHandler(...) function.

User Object Data Handling

The functions that accept an object as well as a message, will log a message that is appropriate for that object.

Control

Various system properties (settable on the command line using the -D option) control the behavior of the logging functions:

	log = true|false
	log.format = event-format
 	log.rc = filename to load instead of local .logrc file
	log.errors = true|false
	log.warnings = true|false
	log.notices = true|false
	log.traces = true|false
	log.time.format = short | medium | long | full | 24 | SimpleDateFormat
	log.time.relative = "clock | days | hours | minutes | seconds"
	log.time.zone = GMT etc.
	log.thread.format = thread-format
	log.message.format = message-format
	log.exception.format = message-format
	log.object.format = object-format
	log.handler.name.url =
	    file://abs | file:rel | rmi:///name | jdbc:protocol:name
	log.handler.name.class = FileHandler|StandardOutHandler|...
	log.handler.name.events = error|warnings|...
	log.handler.name.file = filename  (for FileHandler only)
	log.handler.name.maxsize = 12M | 2K | ... (for FileHandler only)
      log.function.exclude = "grace.log..* grace.util..*"
      log.function.include = "grace.log..* grace.util..*"
      log.event.include = "error warn.*"
      log.event.exclude = "trace.* notice.*"
 

Notes

Wish List:


Field Summary
static java.lang.String ERROR
          Can be passed to log(type, ...) or to enableEvent(type) functions.
static java.lang.String NOTICE
          Can be passed to log(type, ...) or to enableEvent(type) functions.
static java.lang.String rcsid
           
static java.lang.String TRACE
          Can be passed to log(type, ...) or to enableEvent(type) functions.
static java.lang.String WARNING
          Can be passed to log(type, ...) or to enableEvent(type) functions.
 
Constructor Summary
Log()
          Logs are constructed internally and usually should not be constructed by the normal user.
 
Method Summary
 void addHandler(Handler handler)
          Add the given handler into this log such that all subsequent messages will be dispatched to this and all previously installed Handlers.
 void addHandler(Handler handler, java.lang.String event)
          Add the given handler into this log such that all subsequent messages of the given event will be dispatched to this and all previously installed Handlers of the given event.
protected  void addHandler(java.lang.String name)
          Given the name of a handler, this looks up the properties to instantiate and install the correct handler.
protected  void addLocalHandler(java.lang.String name, java.lang.Class defaultHandlerClass)
           
protected  void addRemoteObject(java.lang.String name, java.lang.String url)
          This is called when a handler is specified as remote using the log.handler property.
protected  void addToEventHandlers(Handler handler, java.lang.String handlerName, java.lang.String events)
          This adds a handler for each event given in the space separated list of events.
protected  void checkAndBindDistributer()
          This binds the Distributer in the RMI registry if the property is set.
protected  void checkAndBindHandler(java.lang.String name, Handler handler)
          This checks to see if the Handler needs to be bound in the RMI registry as a server.
protected  void dispatch(Handler handler, Event event)
          This function calls the handler.handle(Event) function.
 void distribute(Event event)
          This is the heart of the logging.
static void enableErrors(boolean enabled)
          Enables or disables the logging of errors.
 void enableEventType(java.lang.String eventType, boolean enabled)
           
static void enableNotices(boolean enabled)
          Enables or disables the logging of notices.
static void enableTraces(boolean enabled)
          Enables or disables the logging of traces.
static void enableWarnings(boolean enabled)
          Enables or disables the logging of warnings.
static void error(java.lang.Exception exception)
          This function simply logs the given exception to the log device.
static void error(java.lang.String message)
          This logs the indicated error message text to the configured log device.
static void error(java.lang.String message, java.lang.Exception exception)
          This logs the given message along with the given exception.
static void error(java.lang.String message, java.lang.Object object)
          This logs the error message and then logs the given object.
static boolean errorsEnabled()
           
protected  boolean eventFieldIsInteresting(java.lang.String text, java.util.Vector includeFilter, java.util.Vector excludeFilter)
          This applies the filters against the given text.
protected  boolean eventIsInteresting(Event event)
          Indicates that the given event should be included in the log based on whether the function from which the event was generated matches the filters.
 boolean eventTypeEnabled(java.lang.String type)
          Indicates that the given event type should be included in the log.
static Log getInstance()
          Used to staticly access the singleton log instance.
 java.lang.String getName()
          This returns the name of this log/distributer.
 Properties getProperties()
          Returns the properties list that is statically maintained by this class.
protected  void initialize()
          Initializes all of the elements of a Log/Distributer object.
 void initializeFilters()
          This loads the properties and sets up the filters for including and excluding functions and event types.
static void internal(java.lang.Exception e)
          This function is a very simple way to output a log exceptions without using any of the log dispatching or handling.
static void internal(java.lang.String message)
          This function is a very simple way to output a log message without using any of the log dispatching or handling.
 void loadProperties(java.util.Properties extraProperties)
          Loads the given set of extraProperties without affecting the System properties or the original properties maintained by this Log.
static void log(java.lang.String eventType, java.lang.Object object)
          Logs the given object marked with the given eventType.
static void log(java.lang.String eventType, java.lang.String message)
          Logs the given message marked with the given event type.
static void log(java.lang.String eventType, java.lang.String message, java.lang.Object object)
          Logs the given message and object marked with the given eventType.
protected  void lookupFilterAndAddHandler(Handler handler, java.lang.String name)
          This takes the given handler and handler name and looks up a list of events to which this handler should respond and then installs the handler.
static void main(java.lang.String[] args)
          This main acts as a little test program to test many of the features of the Log.
static void notice(java.lang.String message)
          This logs the indicated notice message text to the configured log device.
static void notice(java.lang.String message, java.lang.Object object)
          This logs the indicated notice message text and the given object to the configured log device.
static boolean noticesEnabled()
           
protected  void removeHandler(Handler toRemove)
          This removes the given handler from all of the handlers - allHandlers and eventHandlers.
protected  void removeObjectFrom(java.util.Hashtable table, java.lang.Object toRemove)
          This removes an object from a hashtable.
protected static java.lang.String replaceBadPunctuation(java.lang.String source)
          This returns a copy of the given string with all puntuation that is offensive to rmi URLs replaced by dots.
 void setEventTypesToExclude(java.lang.String filters)
          Sets the given space separated list of regular expressions that will act as filters to exclude event types in the logging output.
 void setEventTypesToInclude(java.lang.String filters)
          Sets the given space separated list of regular expressions that will act as filters to include event types in the logging output.
 void setFunctionNamesToExclude(java.lang.String filters)
          Sets the given space separated list of regular expressions that will act as filters to exclude functions in the logging output.
 void setFunctionNamesToInclude(java.lang.String filters)
          Sets the given space separated list of regular expressions that will act as filters to include functions in the logging output.
 void setName(java.lang.String name)
          This overrides the default use of the VMID and sets the name of this log.
static void trace()
          This function makes an entry in the log device that indicates the programtic position of the caller.
static void trace(java.lang.Object object)
          This function writes the given object in the log device and makes an entry in the log device that indicates the programtic position of the caller.
static void trace(java.lang.String message)
          This function writes the given message in the log device and makes an entry in the log device that indicates the programtic position of the caller.
static void trace(java.lang.String message, java.lang.Object object)
          This function writes the given message and object in the log device and makes an entry in the log device that indicates the programtic position of the caller.
static boolean tracesEnabled()
           
protected  java.lang.String virtualMachineId()
          Returns the virtual machine id as determined by java.rmi.dgc.VMID but with all of the colons replaced by dots.
static void warning(java.lang.String message)
          This logs the indicated warning message text to the configured log device.
static void warning(java.lang.String message, java.lang.Exception exception)
          This logs the indicated warning message text and give exception to the configured log device.
static void warning(java.lang.String message, java.lang.Object object)
          This logs the indicated warning message text and object to the configured log device.
static boolean warningsEnabled()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rcsid

public static final java.lang.String rcsid

ERROR

public static final java.lang.String ERROR
Can be passed to log(type, ...) or to enableEvent(type) functions. Passing this to log(type, ...) is the same as calling error(...);

WARNING

public static final java.lang.String WARNING
Can be passed to log(type, ...) or to enableEvent(type) functions. Passing this to log(type, ...) is the same as calling warning(...);

NOTICE

public static final java.lang.String NOTICE
Can be passed to log(type, ...) or to enableEvent(type) functions. Passing this to log(type, ...) is the same as calling notice(...);

TRACE

public static final java.lang.String TRACE
Can be passed to log(type, ...) or to enableEvent(type) functions. Passing this to log(type, ...) is the same as calling trace(...);
Constructor Detail

Log

public Log()
Logs are constructed internally and usually should not be constructed by the normal user. The best way to use the log system is to call one of the static functions.
Method Detail

getInstance

public static Log getInstance()
Used to staticly access the singleton log instance. Usually, the static log functions are sufficient for most users but if the user really wants access to an instance, this is it.

log

public static void log(java.lang.String eventType,
                       java.lang.String message)
Logs the given message marked with the given event type. event type is assumed to be some user defined string that indicates the nature of the given message. For example, this could be "error", "warnings", "stats", etc.
Parameters:
eventType - user defined classification of log message
message - free form user message to log

log

public static void log(java.lang.String eventType,
                       java.lang.Object object)
Logs the given object marked with the given eventType. EventType is assumed to be some user defined string that indicates the nature of the given message. For example, this could be "error", "warnings", "stats", etc.
Parameters:
eventType - user defined classification of log message
object - object to log

log

public static void log(java.lang.String eventType,
                       java.lang.String message,
                       java.lang.Object object)
Logs the given message and object marked with the given eventType. EventType is assumed to be some user defined string that indicates the nature of the given message. For example, this could be "error", "warnings", "stats", etc.
Parameters:
eventType - user defined classification of log message
message - free form user message to log
object - object to log

error

public static void error(java.lang.String message)
This logs the indicated error message text to the configured log device. This is equivalent to calling the log function with "error" as the event type.

Error messages should indicate a grave condition in which the programmer can not anticipate the integrity of the running system.

Parameters:
message - to be logged to the log device

error

public static void error(java.lang.String message,
                         java.lang.Object object)
This logs the error message and then logs the given object. The format and extent that this object is logged is dependent on the particular implementation of the log. This is equivalent to calling the log function with "error" as the event type.

Error messages should indicate a grave condition in which the programmer can not anticipate the integrity of the running system.

Parameters:
message - to be logged to the log device
object - to be logged to log device in implementation specific manner.

error

public static void error(java.lang.Exception exception)
This function simply logs the given exception to the log device. The format and that extent the exception is logged is dependent on the particular implementation of the log. This is equivalent to calling the log function with "error" as the event type.

Error messages should indicate a grave condition in which the programmer can not anticipate the integrity of the running system.

Parameters:
object - to be logged to log device in implementation specific manner.

error

public static void error(java.lang.String message,
                         java.lang.Exception exception)
This logs the given message along with the given exception. The format and that extent the exception is logged is dependent on the particular implementation of the log. This is equivalent to calling the log function with "error" as the event type.

Error messages should indicate a grave condition in which the programmer can not anticipate the integrity of the running system.


warning

public static void warning(java.lang.String message)
This logs the indicated warning message text to the configured log device. This is equivalent to calling the log function with "warning" as the event type.

Warning messages should indicate a problem in the system but one which the programmer expects will not affect the immediate integrity of the running system.

Parameters:
message - to log

warning

public static void warning(java.lang.String message,
                           java.lang.Object object)
This logs the indicated warning message text and object to the configured log device. The format of the object in the log is specific to the particular log implmentation. This is equivalent to calling the log function with "warning" as the event type.

Warning messages should indicate a problem in the system but one which the programmer expects will not affect the immediate integrity of the running system.

Parameters:
message - to log

warning

public static void warning(java.lang.String message,
                           java.lang.Exception exception)
This logs the indicated warning message text and give exception to the configured log device. The format of the object in the log is specific to the particular log implmentation. This is equivalent to calling the log function with "warning" as the event type.

Warning messages should indicate a problem in the system but one which the programmer expects will not affect the immediate integrity of the running system.

Parameters:
message - to be logged
exception - to be logged

notice

public static void notice(java.lang.String message)
This logs the indicated notice message text to the configured log device. This is equivalent to calling the log function with "warning" as the event type.

Notices messages should be used to communicate situations that have developed that are part of the normal operation of the system. This is equivalent to calling the log function with "notice" as the event type.

Parameters:
message - to log

notice

public static void notice(java.lang.String message,
                          java.lang.Object object)
This logs the indicated notice message text and the given object to the configured log device. The object is written in an implmentation specific to the particular log device. This is equivalent to calling the log function with "notice" as the event type.

Notices messages should be used to communicate situations that have developed that are part of the normal operation of the system.

Parameters:
message - to log
object - to log in implementation specific format

trace

public static void trace()
This function makes an entry in the log device that indicates the programtic position of the caller. Typically this will include the filename and line number and could also include the class name and function name. This is equivalent to calling the log function with "trace" as the event type.

trace

public static void trace(java.lang.String message)
This function writes the given message in the log device and makes an entry in the log device that indicates the programtic position of the caller. Typically this will include the filename and line number and could also include the class name and function name. This is equivalent to calling the log function with "trace" as the event type.
Parameters:
message - to log

trace

public static void trace(java.lang.Object object)
This function writes the given object in the log device and makes an entry in the log device that indicates the programtic position of the caller. Typically this will include the filename and line number and could also include the class name and function name. Both the object and the trace message are specific to the log implementation. This is equivalent to calling the log function with "trace" as the event type.
Parameters:
object - to log in implementation specific manner

trace

public static void trace(java.lang.String message,
                         java.lang.Object object)
This function writes the given message and object in the log device and makes an entry in the log device that indicates the programtic position of the caller. Typically this will include the filename and line number and could also include the class name and function name. Both the object and the trace message are specific to the log implementation. This is equivalent to calling the log function with "trace" as the event type.
Parameters:
message - to log
object - to log in implementation specific manner

internal

public static void internal(java.lang.String message)
This function is a very simple way to output a log message without using any of the log dispatching or handling. This is mainly used by the internal log system to avoid any kind of recursion problems when the internal log system needs to log its own messages. All exceptions are printed to the standard

internal

public static void internal(java.lang.Exception e)
This function is a very simple way to output a log exceptions without using any of the log dispatching or handling. This is mainly used by the internal log system to avoid any kind of recursion problems when the internal log system needs to log its own exceptions. All exceptions are printed to the standard out.

getName

public java.lang.String getName()
This returns the name of this log/distributer. This name defaults to the virtual machine id as determined by java.rmi.dgc.VMID, with all of the colons removed and a sequence number added to the end. This can be used to uniquely identify any log/distributer on the net.

The property log.name can be used to override the use of the VMID and use the user supplied name as a prefix with the sequence number.

Specified by:
getName in interface Distributer

setName

public void setName(java.lang.String name)
This overrides the default use of the VMID and sets the name of this log.
Specified by:
setName in interface Distributer

virtualMachineId

protected java.lang.String virtualMachineId()
Returns the virtual machine id as determined by java.rmi.dgc.VMID but with all of the colons replaced by dots.

replaceBadPunctuation

protected static java.lang.String replaceBadPunctuation(java.lang.String source)
This returns a copy of the given string with all puntuation that is offensive to rmi URLs replaced by dots.

dispatch

protected void dispatch(Handler handler,
                        Event event)
This function calls the handler.handle(Event) function. This catches the case when remote handlers are called and the event.object is not serializable. In this case, the object is formatted in a default style (Java) and sent off as a String.
Parameters:
handler - to call the handle function for the event
event - to pass to the handle function

removeHandler

protected void removeHandler(Handler toRemove)
This removes the given handler from all of the handlers - allHandlers and eventHandlers.

removeObjectFrom

protected void removeObjectFrom(java.util.Hashtable table,
                                java.lang.Object toRemove)
This removes an object from a hashtable. The bloody hastable can not remove an object from itself - only a key.

distribute

public void distribute(Event event)
This is the heart of the logging. It takes an Event and calls each of the appropriate filtered Handlers and then calls each one of the Handlers that handles all events.
Specified by:
distribute in interface Distributer
Parameters:
event - to log

eventIsInteresting

protected boolean eventIsInteresting(Event event)
Indicates that the given event should be included in the log based on whether the function from which the event was generated matches the filters. This uses the functionNamesToInclude/Exclude filters setup in the init function.

eventFieldIsInteresting

protected boolean eventFieldIsInteresting(java.lang.String text,
                                          java.util.Vector includeFilter,
                                          java.util.Vector excludeFilter)
This applies the filters against the given text. First the inclusion filters are applied and then the exclusion filters applied against the results of the inclusion filter. Note, an empty includeFilter means include everything. An empty excludeFilter means exclude nothing.
Parameters:
text - to include/exclude using filters
includeFilter - Vector matches against which will return true
excludeFilter - Vector matches against which will return false
Returns:
whether includeFilter matched and excludeFilter didn't match

enableErrors

public static void enableErrors(boolean enabled)
Enables or disables the logging of errors. Can be called at any point during the execution of the program.

errorsEnabled

public static boolean errorsEnabled()

enableWarnings

public static void enableWarnings(boolean enabled)
Enables or disables the logging of warnings. Can be called at any point during the execution of the program.

warningsEnabled

public static boolean warningsEnabled()

enableNotices

public static void enableNotices(boolean enabled)
Enables or disables the logging of notices. Can be called at any point during the execution of the program.

noticesEnabled

public static boolean noticesEnabled()

enableTraces

public static void enableTraces(boolean enabled)
Enables or disables the logging of traces. Can be called at any point during the execution of the program.

tracesEnabled

public static boolean tracesEnabled()

enableEventType

public void enableEventType(java.lang.String eventType,
                            boolean enabled)
Specified by:
enableEventType in interface Distributer

eventTypeEnabled

public boolean eventTypeEnabled(java.lang.String type)
Indicates that the given event type should be included in the log. This uses the eventTypesToInclude/Exclude filters setup in the init function.
Specified by:
eventTypeEnabled in interface Distributer

addHandler

public void addHandler(Handler handler)
Add the given handler into this log such that all subsequent messages will be dispatched to this and all previously installed Handlers.
Specified by:
addHandler in interface Distributer

addHandler

public void addHandler(Handler handler,
                       java.lang.String event)
Add the given handler into this log such that all subsequent messages of the given event will be dispatched to this and all previously installed Handlers of the given event.
Specified by:
addHandler in interface Distributer

addToEventHandlers

protected void addToEventHandlers(Handler handler,
                                  java.lang.String handlerName,
                                  java.lang.String events)
This adds a handler for each event given in the space separated list of events.

addHandler

protected void addHandler(java.lang.String name)
Given the name of a handler, this looks up the properties to instantiate and install the correct handler.

addLocalHandler

protected void addLocalHandler(java.lang.String name,
                               java.lang.Class defaultHandlerClass)

checkAndBindHandler

protected void checkAndBindHandler(java.lang.String name,
                                   Handler handler)
This checks to see if the Handler needs to be bound in the RMI registry as a server. The bind is optional so that the normal local logging handlers won't hang the program when the program completes normally.

property log.handler.name.server true|false false installs the named handler in the RMI registry with the key "log.handler.name.vmid".

Parameters:
name - name of handler to bind
handler - to bind

checkAndBindDistributer

protected void checkAndBindDistributer()
This binds the Distributer in the RMI registry if the property is set. This is useful if the Distributer will be used as a remote centralised server. property log.distributer.vmid

addRemoteObject

protected void addRemoteObject(java.lang.String name,
                               java.lang.String url)
This is called when a handler is specified as remote using the log.handler property. This queries the remote object and installs the remote object or the ProxyHandler depending on what type the remote object is.

lookupFilterAndAddHandler

protected void lookupFilterAndAddHandler(Handler handler,
                                         java.lang.String name)
This takes the given handler and handler name and looks up a list of events to which this handler should respond and then installs the handler.

setFunctionNamesToInclude

public void setFunctionNamesToInclude(java.lang.String filters)
Sets the given space separated list of regular expressions that will act as filters to include functions in the logging output. When distributing a log event, each space separated expression in the filter string is matched against the concatenation of the full classname and the function name (without the signature). If any one expression matches, the event is distributed.

Calling this function overrides any values specified in the property "log.function.include".

Note, the include list is processed before the exclude list. This means any event included by this filter can be subsequently excluded by the exclude list.

Some useful expressions are:

  • "grace\.MyClass\..*" logs all events produced by the class grace.MyClass.
  • "grace\.*" will log all events produced by all classes and functions in the grace package.
  • "grace\.MyClass\.myFunc" logs all events produced by grace.MyClass.myFunc().
Parameters:
filters - space separated list of regular expressions

setFunctionNamesToExclude

public void setFunctionNamesToExclude(java.lang.String filters)
Sets the given space separated list of regular expressions that will act as filters to exclude functions in the logging output. When distributing a log event, each space separated expression in the filter string is matched against the concatenation of the full classname and the function name (without the signature). If any one expression matches, the event is not distributed.

Calling this function overrides any values specified in the property "log.function.exclude".

Note, the exclude list is processed after the include list. This means that this filter has the utlitimate decision of whether the event is distributed.

Some useful expressions are:

  • "grace\.MyClass\..*" eliminates all events produced by the class grace.MyClass.
  • "grace\.*" eliminates all events produced by all classes and functions in the grace package.
  • "grace\.MyClass\.myFunc" eliminates all events produced by grace.MyClass.myFunc().
Parameters:
filters - space separated list of regular expressions

setEventTypesToInclude

public void setEventTypesToInclude(java.lang.String filters)
Sets the given space separated list of regular expressions that will act as filters to include event types in the logging output. When distributing a log event, each space separated expression in the filter string is matched against the event type (error, warning, notice, etc). If any one expression matches, the event is distributed.

Calling this function overrides any values specified in the property "log.event.include".

Note, the include list is processed before the exclude list. This means any event included by this filter can be subsequently excluded by the exclude list.

Some useful expressions are:

  • ".*" includes all events types.
  • "error warning" includes all error and warning events.
  • "stat.*" includes all events starting with 'stat'.
Parameters:
filters - space separated list of regular expressions

setEventTypesToExclude

public void setEventTypesToExclude(java.lang.String filters)
Sets the given space separated list of regular expressions that will act as filters to exclude event types in the logging output. When distributing a log event, each space separated expression in the filter string is matched against the event type If any one expression matches, the event is not distributed.

Calling this function overrides any values specified in the property "log.event.exclude".

Note, the exclude list is processed after the include list. This means that this filter has the utlitimate decision of whether the event is distributed.

Parameters:
filters - space separated list of regular expressions

getProperties

public Properties getProperties()
Returns the properties list that is statically maintained by this class.

loadProperties

public void loadProperties(java.util.Properties extraProperties)
Loads the given set of extraProperties without affecting the System properties or the original properties maintained by this Log. It loads the given extraProperties into a new, temporary set of internally properties, loads the given extraProperties, reinitializes all of the filters with the revised set of properties, then sets the properties back to the original set.
Parameters:
extraProperties - to merge into the current set

initializeFilters

public void initializeFilters()
This loads the properties and sets up the filters for including and excluding functions and event types. Each time it is called, it clears the functionNamesToInclude, functionNamesToExclude, eventTypesToInclude, and eventTypesToExclude.

initialize

protected void initialize()
Initializes all of the elements of a Log/Distributer object. This means setting up handlers, of if none, at least one standard out handler, setting up the enabled function and event type filters, and binding this distributer object in the local rmi register, if requested.

main

public static void main(java.lang.String[] args)
This main acts as a little test program to test many of the features of the Log. It tests some multi-threaded behavior as well as many of the functions. Unfortunately, since most of the functions output text in user configurable way, this test doesn't do anything more than print out a bunch of text and let the user see if it looks correct.