Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-603

Allow multiple addresses for "to" property of SMTPAppender

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Major Major
    • 0.9.30
    • None
    • None
    • None

    Description

      SMTPAppender don`t allow to specify multiple addresses in single "to" property. So that, it is (almost?) impossible to specify multiple "to"
      addresses via variable substitution. We should know exact number of addresses (variables) to specify appropriate quantity of <to>
      elements. But number of "to" addresses could be changed during application using and differ from customer to customer. So, IMFO it
      will be helpful to allow specifying multiple addresses in one <to> element. Multiple addresses could be separated by comma, for example (as comma is not valid character for email address).

      Right now we are using simple workaround. We subclass SMTPAppender and overwrite addTo():

          @Override
          public void addTo(String to) {
              StringTokenizer st = new StringTokenizer(to, ",");
              while(st.hasMoreTokens()) {
                  super.addTo(st.nextToken().trim());
              }
          }
      

      This solution works just fine for us. May be it will be good to include this feature in core logback too.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            ciand7 Andrey Utkin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: