Here's a snippet containing my Logback SMTPAppender
:
<appender name="logManager-smtpAppender" class="ch.qos.logback.classic.net.SMTPAppender">
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>WARN</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>NEUTRAL</onMismatch>
</filter>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<asynchronousSending>false</asynchronousSending>
<smtpHost>my.smtp.host</smtpHost>
<to>[email protected]</to>
<from>[email protected]</from>
<username>my_smtp_user</username>
<password>my_smtp_password</password>
<subject>%logger{20} - %m</subject>
<layout class="ch.qos.logback.classic.html.HTMLLayout"/>
<cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
<bufferSize>1</bufferSize>
</cyclicBufferTracker>
</appender>
When the following Java executes:
logger.warn("This is a warning.");
logger.error("This is an error.");
I only get 1 email. By setting bufferSize
to 1 I would have expected to get 2 different emails with 1 single log message in each of them. What's going on?