Thanks for the pointer Lutz, I definitely would have missed that even if I had gone into the Javadocs because that tip is buried in the section under the default constructor. After reading other posts, it seems that this is a bug that affects logback 1.0.0. When I downgraded to version 0.9.30, things worked as expected and I was able to send SSL mail through Gmail.<br>
<br>Thanks,<br>Alex<br><br><div class="gmail_quote">2012/3/3 Lutz Hühnken <span dir="ltr"><<a href="mailto:lh.logback.list@googlemail.com">lh.logback.list@googlemail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Alex,<br>
<br>
although I am having issues with the SMTPAppender myself (as you<br>
noticed - <a href="http://jira.qos.ch/browse/LBCLASSIC-323" target="_blank">http://jira.qos.ch/browse/LBCLASSIC-323</a>), you may be facing<br>
something else here.<br>
<br>
In your example, it seems the log event that you wish to trigger the<br>
e-mail with ("SmtpTest - Hello World") has the level "INFO". Please<br>
note (quote from the docs):<br>
<br>
"By default, the email transmission is triggered by a logging event of<br>
level ERROR. "<br>
<br>
Log it as an error and see what happens.<br>
<br>
If you wish to trigger mail for INFO events, you need to provide a<br>
different "EventEvaluator". Go to<br>
<a href="http://logback.qos.ch/manual/appenders.html" target="_blank">http://logback.qos.ch/manual/appenders.html</a> and search for the section<br>
with the headline "Triggering event" for details.<br>
<br>
Hth,<br>
Lutz<br>
<br>
<br>
On Fri, Mar 2, 2012 at 6:46 PM, Alex Glass <<a href="mailto:alexander.glass@gmail.com">alexander.glass@gmail.com</a>> wrote:<br>
><br>
> I'm trying to use SMTPAppender to send a log message through gmail. I have added javax.mail:mailapi:1.4.3 as a depdendency. I also tried adding javax.activation:activation:1.1.1 with no success. If I change the host to xyz, it has no affect. This is my configuration file:<br>
><br>
> <configuration debug="true"><br>
> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"><br>
> <encoder><br>
> <pattern><br>
> %-4relative [out] %-5level %logger - %msg%n<br>
> </pattern><br>
> </encoder><br>
> </appender><br>
><br>
> <appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender"><br>
> <smtpHost><a href="http://smtp.gmail.com" target="_blank">smtp.gmail.com</a></smtpHost><br>
> <smtpPort>465</smtpPort><br>
> <SSL>true</SSL><br>
> <username><a href="mailto:somebody@gmail.com">somebody@gmail.com</a></username><br>
> <password>somepass</password><br>
> <to><a href="mailto:someone@gmail.com">someone@gmail.com</a></to><br>
> <from><a href="mailto:somebody@gmail.com">somebody@gmail.com</a></from><br>
> <subject>Testing %logger{20} - %m</subject><br>
><br>
> <layout class="ch.qos.logback.classic.PatternLayout"><br>
> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{1} - %msg%n</pattern><br>
> </layout><br>
> </appender><br>
><br>
> <root level="info"><br>
> <appender-ref ref="STDOUT" /><br>
> <appender-ref ref="EMAIL" /><br>
> </root><br>
> </configuration><br>
><br>
><br>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
> Console output<br>
><br>
> 12:45:56,627 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]<br>
> 12:45:56,630 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]<br>
> 12:45:56,644 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property<br>
> 12:45:56,668 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.net.SMTPAppender]<br>
> 12:45:56,678 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [EMAIL]<br>
> 12:45:56,714 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO<br>
> 12:45:56,714 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]<br>
> 12:45:56,715 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [EMAIL] to Logger[ROOT]<br>
> 12:45:56,715 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.<br>
><br>
> 180 [out] INFO SmtpTest - Hello World<br>
><br>
> _______________________________________________<br>
> Logback-user mailing list<br>
> <a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
> <a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><br>
_______________________________________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Alexander Glass<br>AGS Consulting<br>(917) 670 7506<br><a href="http://www.ags-consulting.net">www.ags-consulting.net</a><br>