[logback-user] Issues configuring GMail appender

Greg Silin greg at klout.com
Tue Jan 3 20:26:00 CET 2012


Hi,

I'm trying to setup logback for a fairly simple appender configuration..

DEBUG, INFO, WARN: System.out Console Appender, File Appender
ERROR: System.err Console Appender, File Appender, SMTPAppender configured
for GMail.

Following instructions to setup GMail appender, I have the following:

Appender config:

    <!-- Email appender -->
    <appender name="MailAppender"
class="ch.qos.logback.classic.net.SMTPAppender">
        <smtpHost>smtp.gmail.com</smtpHost>
        <smtpPort>465</smtpPort>
        <ssl>true</ssl>
        <username>MyUsername</username>
        <password>MyPassword</password>

        <to>greg at klout.com</to>
        <!--<to>ANOTHER_EMAIL_DESTINATION</to> <!– additional
destinations are possible –>-->
        <from>noreply at gmail.com</from>
        <subject>LOGGED ERROR: %logger{20} - %m</subject>
        <layout class="ch.qos.logback.classic.PatternLayout">
            <pattern>%date %-5level %logger{35} -
%message%n%xEx{35}</pattern>
        </layout>
    </appender>

Appender inclusion:

    <root level="ERROR">
        <appender-ref ref="StdErrAppender" />
        <appender-ref ref="FileAppender" />
        <appender-ref ref="MailAppender" />
    </root>

All appropriate maven dependencies:

logger jars

        <slf4j.version>1.6.4</slf4j.version>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-access</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.0.0</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>1.0.0</version>
        </dependency>


java mail
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.4</version>
        </dependency>


All the other appenders work just fine as configured. I see that the
SMTPAppender is being loaded w/o error (at least nothing I see reported) ..
yet on ERROR nothing gets sent.  Username & password are all correct.  I've
confirmed with our operations that we don't have any special spam filters
set up.

Thoughts on what could be wrong / what I need to check?

Thanks
-greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20120103/819e307c/attachment.html>


More information about the Logback-user mailing list