Nagarajan,

Sorry for not replying earlier. The TriggeringEventEvaluator does not filter events at 
all. In particular, even whne the evaluator returns false, the logging event is added 
to the SMTPappender's buffer.

You ask, "should I drop this logging event" to a filter but "should this event trigger 
an email" to a TriggeringEventEvaluator. They are different questions. Hope this 
answers the question. Ceki


At 18:23 15.03.2001 +0530, Nagarajan Chinnasamy wrote:
>Resending as it may not have reached the list...
>
>>  -----Original Message-----
>> From:         Nagarajan Chinnasamy  
>> Sent: Tuesday, March 13, 2001 6:27 PM
>> To:   '[EMAIL PROTECTED]'
>> Subject:      TriggeringEventEvaluator: Is this needed in SMTPAppender?
>> 
>> 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: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


I hope to see you at my ApacheCon 2001 presentation 
entitled "Log4j, A Logging Package for Java".

See http://ApacheCon.Com/2001/US/ for more details.

----
Ceki Gülcü          Web:   http://qos.ch     
av. de Rumine 5     email: [EMAIL PROTECTED] (preferred)
CH-1005 Lausanne           [EMAIL PROTECTED]
Switzerland         Tel: ++41 21 351 23 15


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to