<?xml version="1.0" encoding="UTF-8"?>
<Configuration name="Mailer" packages="org.apache.logging.log4j.core.appender" status="warn">
    <!-- Mail server configuration. You don't need to change these to see the
    problem with SMTPAppender. Because smtpDebug is set to "true" you'll see
    that the appender makes no attempt whatsoever to connect to an SMTP server
    while logging at any level other than fatal or error, thus demonstrating
    the bug. -->
    <properties>
        <property name="receipients">me@example.com</property>
        <property name="from">me@example.com</property>
        <property name="smtpHost">smtp.example.com</property>
        <property name="smtpPort">25</property>
        <property name="smtpProtocol">smtp</property>
        <property name="smtpUser">me</property>
        <property name="smtpPassword">secret</property>
    </properties>
    <Appenders>
        <!-- appender to send mails (default: error and fatal events) -->
        <SMTP name="Mailer" ignoreExceptions="false" subject="Error log"
              to="${receipients}" from="${from}" smtpHost="${smtpHost}" smtpPort="${smtpPort}"
              smtpProtocol="${smtpProtocol}" smtpUsername="${smtpUser}"
              smtpPassword="${smtpPassword}" smtpDebug="true" bufferSize="2">
            <ThresholdFilter level="debug" onMatch="NEUTRAL" onMismatch="DENY"/>
        </SMTP>
        <!-- appender to send mails asynchronously -->
        <Async name="AsyncMailer">
            <appender-ref ref="Mailer"/>
        </Async>
    </Appenders>
    <Loggers>
        <!-- logger to send mail on (at least) info level events -->
        <Logger name="LogTest" level="debug" additivity="true">
            <appender-ref ref="AsyncMailer"/>
        </Logger>
    </Loggers>
</Configuration>