logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nagarajan Chinnasamy" <nagaraj...@mindtree.com>
Subject TriggeringEventEvaluator: Is this needed in SMTPAppender?
Date Tue, 13 Mar 2001 12:57:20 GMT
Hello ALL,

Just a thought/question on the need for TriggeringEventEvaluator
used in SMTPAppender.

If I understood right, all that TriggeringEventEvaluator does is to
evaluate a logging event to decide whether to send the event as
a mail or not. So, what basically it does is filtering.

If so, why do we need this special usage? We already have Filters
that can be configured for appenders.

Infact, from the source code, I understand that the default evaluator
is nothing but a priority filter that filters out the messages with priority
less than ERROR. I am reproducing the code here:

class DefaultEvaluator implements TriggeringEventEvaluator {
  /**
     Is this <code>event</code> the e-mail triggering event?
     
     <p>This method returns <code>true</code>, if the event priority
     has ERROR priority or higher. Otherwisem it returns
     <code>false</code>. */
  public 
  boolean isTriggeringEvent(LoggingEvent event) {
    return event.priority.isGreaterOrEqual(Priority.ERROR); 
  }
}

Isn't it a good idea to leave it to work under the usual framework of having
filters do this job rather than having special evaluators???

I am looking at: jakarta-log4j-1.0.4

Regards,
nagu.



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org


Mime
View raw message