Hi Simon,

The BufferSize represents the maximum number of messages that can be accumulated and 
sent when the triggering event occurs.

The triggering event is by defaut an error or fatal message. This can be changed. For 
example, if you set the buffer size to 3 and the sequence of logs is:

debug  <-- message 1
debug  <-- message 2
debug  <-- message 3
warn   <-- message 4
info   <-- message 5
error  <-- message 6 (triggering event) 

Then, messages 4,5 and 6 will be included in the email generated by the SMTPAppender. 
If the buffer size was 5, then messages 2,3,4,5 and 6 would have been included. If the 
buffer size were 10'000, then messages 1 through 6 would be included. Does that help? 
Ceki


At 10:58 06.02.2001 +0100, you wrote:
>Thanks for your idea.
>But does it mean that the BufferSize parameter does not work ? Or maybe I don't 
>understand its goal...
> 
>Simon BRANDHOF  
>-----Message d'origine----- 
>De : Jim Moore [mailto:[EMAIL PROTECTED]] 
>Envoyé : lundi 5 février 2001 23:33 
>À : 'LOG4J Users Mailing List' 
>Objet : RE: SMTPAppender buffer size
>
>Hacking something out, it would be: 
>  
>public TriggerAfter40LogEvents implements TriggeringEventEvaluator { 
>  private int count; 
>  public TriggerAfter40LogEvents() { 
>    count = 0; 
>  } 
>  public boolean isTriggeringEvent(LoggingEvent event) { 
>    if (count == 39) { 
>      count = 0; 
>      return true; 
>    } 
>    else { 
>      count++; 
>      return false; 
>    } 
>  } 
>} 
>  
>Then use that as your trigger.  Obviously, the above isn't very maintainable, but you 
>get the idea.
>
>-Jim Moore 
>"Pinky, you've left the lens cap of your mind on again." - The Brain. 
>-----Original Message----- 
>From: BRANDHOF Simon [mailto:[EMAIL PROTECTED]] 
>Sent: Monday, February 05, 2001 6:38 AM 
>To: '[EMAIL PROTECTED]' 
>Subject: SMTPAppender buffer size
>
>Hi, 
>
>I hava problems using the 'BufferSize' option of the SMTPAppender.  
>Whatever its value, it always sends one mail by log.  
>Does anyone know how could I send a mail after only N logs ? 
>
>Thanks

----
Ceki Gülcü           e-mail: [EMAIL PROTECTED] (preferred)
av. de Rumine 5              [EMAIL PROTECTED]
CH-1005 Lausanne          
Switzerland            Tel: ++41 21 351 23 15


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

Reply via email to