[ 
https://issues.apache.org/jira/browse/LOG4J2-549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13912061#comment-13912061
 ] 

Olivier Lemasle commented on LOG4J2-549:
----------------------------------------

Hi,

I'm not sure it's a bug.
In fact, SMTPAppender works currently as I expected it (as a user), but I'm not 
sure if it's what the developers expected.

In my understanding, the bufferSize is the number of events that should be 
included in each mail, even if only one event triggers the mail.

For example, in my application, I use a SMTPAppender with:
- a ThresholdFilter with level=FATAL
- bufferSize = 15

Therefore, an email alert is sent only when a FATAL event occurs, but 15 events 
are included in the mail (the FATAL event and the 14 events prior to the FATAL 
event). If a second FATAL event occurs, a new mail is sent.

I suppose you wanted to use the ThresholdFilter to limit the number of emails 
by grouping several triggering events in one mail.
There is already an opened issue for that: LOG4J2-252.

By the way, the documentation for BufferSize is quite misleading (as 
[~tomrk1089] pointed in the first comment on LOG4J2-252) because there is at 
least two ways to understand it.

I have nothing against a new parameter used to send an email only when several 
events have been sent. But I'd like not to see the current implementation 
disappear.

> SMTPAppender send one LogEvent by mail even if bufferSize set to 10
> -------------------------------------------------------------------
>
>                 Key: LOG4J2-549
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-549
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.0-beta9, 2.0-rc1
>            Reporter: Erwan LEGELEUX
>         Attachments: SMTPAppender.java, SMTPManager.java
>
>
> Hello, 
> I am trying to use SMTPAppender like I use it with Log4j v1.
> So I used this : 
> <SMTP name="MAIL" subject="[NOSICA ERROR LOG][${user.name}]ErrorList!! " 
> to="toxxxxx" from="fromxxxxxx" smtpHost="hostxxxxxxx" bufferSize="10"></SMTP>
> with a buffer size of 10. 
> And I receive one mail by event. It appears to do not use this parameter like 
> it does with Log4j v1.
> Also, I thought to use EvaluatorClass property but it seems that you do not 
> maintain this features. 
> Do you think you will put it back in next version ?
>               
> Thank you very much for all,
> Regards,
> Erwan



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to