net.dpml.depot
Class DepotHandler

java.lang.Object
  extended byjava.util.logging.Handler
      extended bynet.dpml.depot.DepotHandler

public class DepotHandler
extends Handler

Logging message handler that redirects log messages from a subprocess to a remote logging system.

Version:
1.0.1
Author:
Digital Product Meta Library

Constructor Summary
DepotHandler()
          Creation of a new handler instance.
DepotHandler(String host, int port)
          Creation of a new handler instance.
 
Method Summary
 void close()
          Close the log record handler.
 void flush()
          Flush the handler.
 void publish(LogRecord record)
          Publish a log record.
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DepotHandler

public DepotHandler()
             throws Exception
Creation of a new handler instance.

Throws:
Exception - if an error occurs

DepotHandler

public DepotHandler(String host,
                    int port)
             throws IOException
Creation of a new handler instance.

Parameters:
host - the log server host
port - the port
Throws:
IOException - if an IO error occurs
Method Detail

flush

public void flush()
Flush the handler.


close

public void close()
Close the log record handler.


publish

public void publish(LogRecord record)
Publish a log record. The implementation packages the supplied log record under a LogStatement, binding the record with the associated process identifier. The statement is subsequently writen to a socket established within the instance constructor.

Parameters:
record - the log record to publish