logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ilya Tepikin <ilya.tepi...@gmail.com>
Subject log4j2 SMTP Appender: include previous messages with another level
Date Fri, 10 Jan 2014 17:29:53 GMT
Hi All,

I'm using log4j2-beta9 and I have the following config (part of it):

    <Appenders>
        <SMTP name="Mailer" suppressExceptions="false"
              subject="${subject}" to="${receipients}" from="${from}"
              smtpHost="${smtpHost}" smtpPort="${smtpPort}"
              smtpProtocol="${smtpProtocol}" smtpUsername="${smtpUser}"
              smtpPassword="${smtpPassword}" smtpDebug="false"
bufferSize="20">
            <PatternLayout>
                <pattern>%d{dd-MM-yyyy HH:mm:ss,SSS} %5p %m%n</pattern>
            </PatternLayout>
        </SMTP>

        <Async name="AsyncMailer">
            <AppenderRef ref="Mailer"/>
        </Async>
    </Appenders>
    <Loggers>
        <Root level="info">
            <AppenderRef ref="AsyncMailer" level="error"/>
        </Root>
    </Loggers>

With this configuration I receive email with just 1 error message.
How can I configure log4j2 to receive 1 error message and N previous
messages with LEVEL=INFO?

Thanks in advance. And thanks for such a great lib!

-- 
Sincerely,
Ilya Tepikin.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message