You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Kn, Guruprasad (MED)" <Gu...@geind.ge.com> on 2002/06/26 10:05:20 UTC

Problems with SMTPAppender

Hi
I am using the SMTPAppender and I face the following problem. I have written
my own TriggeringEvaluator which restricts the number of mail that is sent
within a particular period as well as based on the Level(which anyway the
default evaluator also does). However I notice a strange problem
"The SMTPAppender appends the event irrespective of whether the evaluator
conditions are passed or not. So I get mails which has events that should
have been filtered through by the evaluator"
On closer look at the source code, I find that the event is put into the
Cyclic buffer even before the evaluator check is done in the void append()
function. 
SO a scenario like this would be allowed assuming that the Level cut-off is
at ERROR
Log a INFO message - no mail immediately sent, but put into the buffer
Log a ERROR message - mail is sent but the contents of buffer is sent, this
means that the old INFO message is tagged along a ERROR message and sent. 

My question is : "Should not the message be put into cyclic buffer only if
the triggering conditions are met"

I will be extremely thankful if someone could help me in this aspect

Thanks and regards
Guru


"THIS E-MAIL MESSAGE ALONG WITH ANY ATTACHMENTS IS INTENDED ONLY FOR THE
ADDRESSEE and may contain confidential and privileged information.
If the reader of this message is not the intended recipient,
you are notified that any dissemination, distribution or copy of this 
communication is strictly Prohibited. 
If you have received this message by error, please notify us 
immediately, return the original mail to the sender and delete the 
message from your system."


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Problems with SMTPAppender

Posted by Ceki Gülcü <ce...@qos.ch>.
The triggering evaluator evaluates whether an email message should be sent 
or not. It does not influence whether an event is put on the cyclic buffer 
or not. If you want only ERROR messages or above, then you can set the 
Threshold of the SMTPAppender.

At 13:35 26.06.2002 +0530, Kn, Guruprasad (MED) wrote:
>Hi
>I am using the SMTPAppender and I face the following problem. I have written
>my own TriggeringEvaluator which restricts the number of mail that is sent
>within a particular period as well as based on the Level(which anyway the
>default evaluator also does). However I notice a strange problem
>"The SMTPAppender appends the event irrespective of whether the evaluator
>conditions are passed or not. So I get mails which has events that should
>have been filtered through by the evaluator"
>On closer look at the source code, I find that the event is put into the
>Cyclic buffer even before the evaluator check is done in the void append()
>function.
>SO a scenario like this would be allowed assuming that the Level cut-off is
>at ERROR
>Log a INFO message - no mail immediately sent, but put into the buffer
>Log a ERROR message - mail is sent but the contents of buffer is sent, this
>means that the old INFO message is tagged along a ERROR message and sent.
>
>My question is : "Should not the message be put into cyclic buffer only if
>the triggering conditions are met"
>
>I will be extremely thankful if someone could help me in this aspect
>
>Thanks and regards
>Guru

--
Ceki


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>