[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.29-8-gbca247d

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Wed Jun 29 12:21:22 CEST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".

The branch, master has been updated
       via  bca247de428261b8c99c2a02cc4fc8ca580d78d2 (commit)
       via  2b2edb0cc0d0e8c3f8c26a39e40811181aa4f632 (commit)
      from  38d48fc3abfb16ca5a72668780ed5501ad3e422b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=bca247de428261b8c99c2a02cc4fc8ca580d78d2
http://github.com/ceki/logback/commit/bca247de428261b8c99c2a02cc4fc8ca580d78d2

commit bca247de428261b8c99c2a02cc4fc8ca580d78d2
Merge: 38d48fc 2b2edb0
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Wed Jun 29 12:12:36 2011 +0200

    Merge commit '2b2edb0cc0d0e8c3f8c26a39e40811181aa4f63'


http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=2b2edb0cc0d0e8c3f8c26a39e40811181aa4f632
http://github.com/ceki/logback/commit/2b2edb0cc0d0e8c3f8c26a39e40811181aa4f632

commit 2b2edb0cc0d0e8c3f8c26a39e40811181aa4f632
Author: Alexandre Garnier <zigarn at gmail.com>
Date:   Tue Jun 28 22:56:24 2011 +0200

    Allow multiple recipient address in 1 <to> element in SMTPAppender (LBCORE-213)

diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_GreenTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_GreenTest.java
index 9e4e4ba..0f39071 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_GreenTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_GreenTest.java
@@ -233,5 +233,20 @@ public class SMTPAppender_GreenTest {
     assertEquals(msg, body);
   }
 
+  @Test
+  public void testMultipleTo() throws Exception {
+    buildSMTPAppender();
+    smtpAppender.setLayout(buildPatternLayout(lc));
+    smtpAppender.addTo("Test <test at example.com>, other-test at example.com");
+    smtpAppender.start();
+    logger.addAppender(smtpAppender);
+    logger.debug("hello");
+    logger.error("en error", new Exception("an exception"));
+
+    StatusPrinter.print(lc);
 
+    MimeMessage[] mma = greenMail.getReceivedMessages();
+    assertNotNull(mma);
+    assertEquals(3, mma.length);
+  }
 }
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_SubethaSMTPTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_SubethaSMTPTest.java
index 49cc3b4..13b9604 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_SubethaSMTPTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/net/SMTPAppender_SubethaSMTPTest.java
@@ -307,6 +307,21 @@ public class SMTPAppender_SubethaSMTPTest {
 
     StatusPrinter.print(lc);
   }
+
+  @Test
+  public void testMultipleTo() throws Exception {
+    smtpAppender.setLayout(buildPatternLayout(lc));
+    smtpAppender.addTo("Test <test at example.com>, other-test at example.com");
+    smtpAppender.start();
+    Logger logger = lc.getLogger("test");
+    logger.addAppender(smtpAppender);
+    logger.debug("hello");
+    logger.error("en error", new Exception("an exception"));
+    List<WiserMessage> wiserMsgList = wiser.getMessages();
+
+    assertNotNull(wiserMsgList);
+    assertEquals(3, wiserMsgList.size());
+  }
   
   public class TrivialAuthHandlerFactory implements AuthenticationHandlerFactory {
     public AuthenticationHandler create() {
diff --git a/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java b/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
index b692cd3..a0d72d0 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/net/SMTPAppenderBase.java
@@ -14,6 +14,7 @@
 package ch.qos.logback.core.net;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
 import java.util.Properties;
@@ -266,8 +267,7 @@ public abstract class SMTPAppenderBase<E> extends AppenderBase<E> {
           continue;
         }
         InternetAddress[] tmp = InternetAddress.parse(email, true);
-        // one <To> element should contain one email address
-        iaList.add(tmp[0]);
+        iaList.addAll(Arrays.asList(tmp));
       } catch (AddressException e) {
         addError("Could not parse email address for [" + toPatternLayoutList.get(i) + "] for event [" + event + "]", e);
         return iaList;

-----------------------------------------------------------------------

Summary of changes:
 .../classic/net/SMTPAppender_GreenTest.java        |   15 +++++++++++++++
 .../classic/net/SMTPAppender_SubethaSMTPTest.java  |   15 +++++++++++++++
 .../ch/qos/logback/core/net/SMTPAppenderBase.java  |    4 ++--
 3 files changed, 32 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Logback: the generic, reliable, fast and flexible logging framework.


More information about the logback-dev mailing list