[ 
https://issues.apache.org/jira/browse/LOG4J2-549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Erwan LEGELEUX updated LOG4J2-549:
----------------------------------

    Attachment: SMTPManager.java
                SMTPAppender.java

I just change : 

@Override
    public void append(final LogEvent event) {
        //manager.sendEvents(getLayout(), event);
        manager.add(event, getLayout());
    }

in SMTPAppender.

And this :

public void add(final LogEvent event, final Layout layout) {                    
                
        
                // Compare to numEvents+1 because we also add current Lo
                if(numEvents+1==data.numElements){
                        this.sendEvents(layout, event);
                        numEvents=0;
                } else {
                        buffer.add(event);
                        numEvents++;
                }
    }


in SMTPManager.

Note that you have to add a numEvents attribute in this class.



> 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
>            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