[logback-user] CyclicBuffer size in SmtpAppender

Dawson Mossman dawsonm at lashpoint.com
Wed Oct 20 15:06:12 CEST 2010


  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