[logback-dev] [JIRA] Commented: (LBCLASSIC-323) SMTPAppender does not send messages

Lutz Huehnken (JIRA) noreply-jira at qos.ch
Wed Mar 14 18:33:26 CET 2012


    [ http://jira.qos.ch/browse/LBCLASSIC-323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12380#action_12380 ] 

Lutz Huehnken commented on LBCLASSIC-323:
-----------------------------------------


I haven't found the time yet to isolate the code where the error occurs from the bigger project it is contained in, but I'll post code and config snippets. Maybe something is so obviously wrong in there that it is sufficient.

The config - in this application, a separate logger category - "myproject.notifications" is used just to send e-mail notifications. 

In logback.xml:

<!-- smtp appenders for e-mail notifications  -->
<appender name="notifications" class="ch.qos.logback.classic.net.SMTPAppender">
	<smtpHost>localhost</smtpHost>
	<to>deletedforlogbackjira at mailinator.com</to>
	<subject>Wichtige Meldung - Bearbeitung erforderlich</subject>
	<layout class="ch.qos.logback.classic.PatternLayout">
		<pattern>%m%n</pattern>
	</layout>
	<cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTrackerImpl">
		<!-- send just one log entry per email -->
		<bufferSize>1</bufferSize>
	</cyclicBufferTracker>
</appender>


<!-- setup loggers -->
<logger name="myproject.notifications" additivity="false" level="INFO">
	<appender-ref ref="notifications" />
</logger>



In the java code:

   ...
   private static final Logger notifier = LoggerFactory.getLogger("myproject.notifications");
   ...

   in some method
   ...
   /* not really an error, but error level is necessary to trigger mail sending */
   notifier.error("some message");
   ...



> SMTPAppender does not send messages
> -----------------------------------
>
>                 Key: LBCLASSIC-323
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-323
>             Project: logback-classic
>          Issue Type: Bug
>          Components: appender
>    Affects Versions: 1.0.0
>         Environment: JDK 1.5
> FreeBSD 7.0-STABLE FreeBSD 7.0-STABLE #0: Tue Apr 15 17:37:45 CEST 2008 amd64
> Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b01)
> Java HotSpot(TM) 64-Bit Server VM (build diablo-1.5.0_07-b01, mixed mode)
>            Reporter: Lutz Huehnken
>            Assignee: Ceki Gulcu
>         Attachments: logback-smtp-copy.xml, pom.xml, SmtpTest.java
>
>
> After upgrading from 0.9.30 to 1.0.0, the ch.qos.logback.classic.net.SMTPAppender seizes to work. It just does not send any messages anymore.
> This behaviour has apparently been observed by others as well and is also described in this thread:
> http://old.nabble.com/SMTPAppender-mail-not-sent-%28logback-1.0.0%2C-JDK-1.5%29-to33164248.html
> It resumes working when - while making no other changes - logback is downgraded to version 0.9.30

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list