I don't know too much about this, but wouldn't you be better using SocketAppender, and 
then from there sending the email?  You would then have the logging implemented in a 
separate JVM, and would be immune to crashes that would affect buffering of data.

Is finalise always called on JVM shutdown?  Not log4j specific, but I wasn't sure if 
finalise was called when the JVM exits.

Thanks for your help in my education ;)

Scott

>>> [EMAIL PROTECTED] 06/26/01 11:00pm >>>
Hi,

my understanding of the SMTPAppender is as follows:
i) it sends all the Logevents in its buffer when it receives an event of 
priority "error".
ii) it stores all events with priority greater-equal the threshold-priority
and
ii) receives all events with priority greater-equal the category-priority.

What I want the SMTPAppender to do is to collect several events and send them 
all at once. This can be done - as was suggested on the list - by providing a 
TriggeringEventEvaluator object that counts up to the desired number of 
messages and sends all of them when the count is reached.

The problem with this approach is that the application may end *before* thec
 ount is reached and the unsended events in the buffer are lost! Okay, there 
is the method sendBuffer(), but if the application is configured via 
property- or xml-file it has no idea of the need to call this method.

For now I will subclass the SMTPAppender and add a finalize() method to call 
the sendBuffer() method before object destruction, but it would be nice toh
 ave this simple extension directly in the SMTPAppender class.

Any objections or other solutions? 

Marco
-- 
Marco Ladermann
dpa, Deutsche Presse-Agentur GmbH
[EMAIL PROTECTED] (PGP-Schlüssel auf Anfrage)
Tel. +49 40 4113 2414   Fax  +49 40 4113 2479

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



-----------------------------------------------------------
This message has been scanned by MailSweeper.
-----------------------------------------------------------



-----------------------------------------------------------
This e-mail is solely for the use of the intended recepient
and may contain information which is confidential or
privileged. Unauthorised use of its contents is prohibited.
If you have received this e-mail in error, please notify 
the sender immediately via e-mail and then delete the 
original e-mail.
-----------------------------------------------------------

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

Reply via email to