logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carn...@apache.org
Subject svn commit: r705057 - /logging/log4j/trunk/src/main/java/org/apache/log4j/net/SMTPAppender.java
Date Wed, 15 Oct 2008 21:31:36 GMT
Author: carnold
Date: Wed Oct 15 14:31:35 2008
New Revision: 705057

URL: http://svn.apache.org/viewvc?rev=705057&view=rev
Log:
Bug 45980: SMTPAppender sendOnClose should only send if there were pending messages

Modified:
    logging/log4j/trunk/src/main/java/org/apache/log4j/net/SMTPAppender.java

Modified: logging/log4j/trunk/src/main/java/org/apache/log4j/net/SMTPAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/src/main/java/org/apache/log4j/net/SMTPAppender.java?rev=705057&r1=705056&r2=705057&view=diff
==============================================================================
--- logging/log4j/trunk/src/main/java/org/apache/log4j/net/SMTPAppender.java (original)
+++ logging/log4j/trunk/src/main/java/org/apache/log4j/net/SMTPAppender.java Wed Oct 15 14:31:35
2008
@@ -280,7 +280,7 @@
   public
   void close() {
     this.closed = true;
-    if (sendOnClose) {
+    if (sendOnClose && cb.length() > 0) {
         sendBuffer();
     }
   }
@@ -353,8 +353,10 @@
 	}
       }
       t = layout.getFooter();
-      if(t != null)
-	sbuf.append(t);
+      if(t != null) {
+	    sbuf.append(t);
+      }
+      
       part.setContent(sbuf.toString(), layout.getContentType());
 
       Multipart mp = new MimeMultipart();



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message