[logback-user] CyclicBuffer size in SmtpAppender

Ceki Gulcu ceki at qos.ch
Wed Oct 20 16:32:20 CEST 2010

Hello Dawson,

I suggest that you vote on http://jira.qos.ch/browse/LBCORE-170


On 20.10.2010 15:06, Dawson Mossman wrote:
> Hi, does anyone know how to change the CyclicBuffer size in the
> SmtpAppender? When an error occurs and an email is sent via the
> Appender, I only want it to show the most recent error (no contextual
> information required). It currently stores 256 contextual logs.
> Logback version: 0.9.25
> When I look at the source code for the SMTPAppender, there is a variable
> named "buffersize", but is not used anywhere in the class. The line
> directly below it used to use the variable, but it's been commented out.
> private int bufferSize = 512;
> //protected CyclicBuffer<ILoggingEvent> cb = new
> CyclicBuffer<ILoggingEvent>(bufferSize);
> Can I use a custom evaluator to do this? Or do I need to write a new
> custom SMTPAppender? Even in the later case, I'm not sure where the
> buffer size is being defined?
> Thanks,
> Dawson

More information about the Logback-user mailing list