net.spy.log
Class SpyLog

java.lang.Object
  extended bynet.spy.SpyObject
      extended bynet.spy.log.SpyLog

public class SpyLog
extends SpyObject

The Spy Asynchronous logger.

SpyLog is an implementation of an asynchronous logger that allows one to have multiple points of input into a single queueing system that runs in its own thread recording the logs.

If this doesn't sound immediately obvious to you, imagine having a transactional system that logs into a database without slowing down the transactions. SpyLog gives you the ability to get a log entry out of your way quickly, to be permanently recorded later.


Constructor Summary
SpyLog(String queueName)
          Instantiate a SpyLog interface for the given queue name with the default flusher.
SpyLog(String queueName, SpyLogFlusher f)
          Instantiate a SpyLog entry with an alternative log flusher.
 
Method Summary
 void addFlusher(SpyLogFlusher f)
          Add another log flusher to the pool.
 void log(SpyLogEntry msg)
          Log an entry.
 void removeFlusher(SpyLogFlusher f)
          Remove the given flusher.
 
Methods inherited from class net.spy.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpyLog

public SpyLog(String queueName)
Instantiate a SpyLog interface for the given queue name with the default flusher.


SpyLog

public SpyLog(String queueName,
              SpyLogFlusher f)
Instantiate a SpyLog entry with an alternative log flusher. An alternative log flusher may log into a SQL database, or to a pager, or email, etc...

Method Detail

addFlusher

public void addFlusher(SpyLogFlusher f)
Add another log flusher to the pool.


removeFlusher

public void removeFlusher(SpyLogFlusher f)
Remove the given flusher.


log

public void log(SpyLogEntry msg)
Log an entry.

Parameters:
msg - SpyLogEntry object to be logged.