[slf4j-user] Asynchronous SMTPAppender

Joe Wang jwang at io-works.com
Tue Jan 17 17:17:27 CET 2012


Hi,

I see in the docs (http://logback.qos.ch/manual/appenders.html) it  
says "SMTP email transmission (sending) is performed asynchronously".   
I'm looking on grepcode.com at version 1.2.25.  I can't see how it is  
sending asynchronously.

SMTPAppender.java
void append(LoggingEvent event) {
...
       sendBuffer();
...
}



void sendBuffer() {
...
       Transport.send(msg);
  ...
}


Transport.java
public static void send(Message msg, Address[] addresses) throws  
MessagingException {
	msg.saveChanges();
	send0(msg, addresses);
     }

private static void send0(Message msg, Address[] addresses) throws  
MessagingException {
...
	/*
	 * Optimize the case of a single protocol.
	 */
	if (dsize == 1) {
	    transport = s.getTransport(addresses[0]);
	    try {
		transport.connect();
		transport.sendMessage(msg, addresses);
	    } finally {
		transport.close();
	    }
	    return;
	}
...
}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0024.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0025.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0026.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0027.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0028.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0029.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0030.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0031.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0032.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0033.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0034.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0035.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0036.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0037.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0038.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0039.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0040.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0041.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0042.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0043.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0044.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0045.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0046.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1x1.gif
Type: image/gif
Size: 43 bytes
Desc: not available
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20120117/ce06c09e/attachment-0047.gif>


More information about the slf4j-user mailing list