[logback-user] smtpappender broken in 1.2.9

Chris Cheshire yahoonomas at gmail.com
Tue Dec 21 16:31:18 CET 2021


Ceki,

I don't use the maven build system - I downloaded manually from the
repo linked on the download page. Redownloaded this morning and
compared - same files (core & classic) as I downloaded yesterday.

Did the build for 1.2.9 miss a commit?

Chris

On Tue, Dec 21, 2021 at 3:26 AM Ceki Gülcü <ceki at qos.ch> wrote:
>
>
>
> Hi Chris,
>
> It looks to me that you are using 1.2.8. Please check both logback-core
> and logback-classic artifacts.
>
> Let us know if that was the case,
> --
> Ceki Gülcü
>
> Please contact suppport(at)qos.ch for donations, sponsorship or support
> contracts related to SLF4J or logback projects.
>
> On 21/12/2021 01:45, Chris Cheshire wrote:
> > Hi,
> >
> > I upgraded logback to 1.2.9 (from 1.2.3) in my webapp (running under
> > tomcat) and now my SMTPAppender configuration is not working. I have
> > file appenders configured too, but they are all working.
> >
> > Relevant config from logback.xml :
> >
> > <property name="SERVER_NAME" value="XXX" />
> > <property name="CONTEXT_PATH" value="XXX" />
> > <property name="LOG_DIR" value="${catalina.base}/logs/${CONTEXT_PATH}"
> > scope="system" />
> >
> > <appender name="email" class="ch.qos.logback.classic.net.SMTPAppender">
> >    <sessionViaJNDI>true</sessionViaJNDI>
> >    <jndiLocation>java:comp/env/mail/XXX</jndiLocation>
> >    <to>XXX</to>
> >    <from>XXX</from>
> >    <subject>XXX</subject>
> >    <layout class="ch.qos.logback.classic.PatternLayout">
> >      <pattern>%date{HH:mm:ss.SSS} [%thread] [%level] %logger#%line
> > %n%n%mdc%n%message%n</pattern>
> >    </layout>
> >    <cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTracker">
> >      <bufferSize>1</bufferSize>
> >    </cyclicBufferTracker>
> >    <includeCallerData>true</includeCallerData>
> > </appender>
> >
> > Relevant resource definition in context.xml
> >    <Resource name="mail/XXX"
> >              auth="Container"
> >              type="javax.mail.Session"
> >              mail.transport.protocol="smtps"
> >              mail.smtp.starttls.enable="true"
> >              mail.smtp.host="XXX"
> >              mail.smtp.port="587" />
> >
> >
> > Found in tomcat's default log:
> >
> > 23:51:33,656 |-INFO in ch.qos.logback.core.joran.action.AppenderAction
> > - About to instantiate appender of type
> > [ch.qos.logback.classic.net.SMTPAppender]
> > 23:51:33,669 |-INFO in ch.qos.logback.core.joran.action.AppenderAction
> > - Naming appender as [email]
> > 23:51:33,711 |-INFO in ch.qos.logback.classic.net.SMTPAppender[email]
> > - Looking up javax.mail.Session at JNDI location
> > [java:comp/env/mail/XXX]
> > 23:51:33,720 |-ERROR in ch.qos.logback.classic.net.SMTPAppender[email]
> > - Failed to obtain javax.mail.Session from JNDI location
> > [java:comp/env/mail/XXX]
> > 23:51:33,720 |-ERROR in ch.qos.logback.classic.net.SMTPAppender[email]
> > - Failed to obtain javax.mail.Session. Cannot start.
> >
> >
> > Nothing else was changed, I just uploaded the new jars and restarted
> > tomcat and now it fails. Downgraded to 1.2.7 and SMTPAppender works
> > again.
> _______________________________________________
> logback-user mailing list
> logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user


More information about the logback-user mailing list