info.informatica.log
Class LogAgent

java.lang.Object
  extended by info.informatica.log.LogAgent
All Implemented Interfaces:
Serializable

public class LogAgent
extends Object
implements Serializable

Log Agent

This class distributes the log messages among the various loggers

Version:
1.02
Author:
amengual at informatica dot info
See Also:
Serialized Form

Constructor Summary
LogAgent(LogConfig logconf)
          Creates a Log Agent according to specified configuration.
 
Method Summary
 void closeLog()
           
 TimerTask getTimerTask()
          Returns a TimerTask than can be used to flush the logs from time to time
 LogEntry[] getUnmatched()
          Returns the latest logs not matched by any rule
 long getUnmatchedCount()
          Returns the count of the latest logs not matched by any rule
 boolean log(String ohost, String clase, int level, String s)
          Given a log message, distribute among loggers
 boolean log(String ohost, String clase, int level, Throwable t, String s)
          Given a log message, distribute among loggers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogAgent

public LogAgent(LogConfig logconf)
Creates a Log Agent according to specified configuration.

Parameters:
logconf - The log system configuration.
Throws:
NullPointerException - if config is null.
Method Detail

log

public boolean log(String ohost,
                   String clase,
                   int level,
                   String s)
            throws LogException
Given a log message, distribute among loggers

Parameters:
ohost - Origin host
clase - Class producing the log
level - Log level
s - Log message
Throws:
LogException

log

public boolean log(String ohost,
                   String clase,
                   int level,
                   Throwable t,
                   String s)
            throws LogException
Given a log message, distribute among loggers

Parameters:
ohost - Origin host
clase - Class producing the log
level - Log level
t - The throwable exception to be logged
s - Log message
Throws:
LogException

closeLog

public void closeLog()
              throws LogException
Throws:
LogException

getUnmatched

public LogEntry[] getUnmatched()
Returns the latest logs not matched by any rule


getUnmatchedCount

public long getUnmatchedCount()
Returns the count of the latest logs not matched by any rule


getTimerTask

public TimerTask getTimerTask()
Returns a TimerTask than can be used to flush the logs from time to time