[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch master updated. v_0.9.30-26-g5c2b54f

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Tue Oct 11 22:53:09 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  5c2b54f9c25b88c3afe1063fcee123b3b200d0c6 (commit)
       via  dd63419d3e2a16c3d706a6a3d8cd37a90ecbcc9f (commit)
       via  da07dc15ebb09c1a882be2596ec1b0cecb1377ab (commit)
      from  b572ad6f784af47731dffcbe3e56476b190ede44 (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=5c2b54f9c25b88c3afe1063fcee123b3b200d0c6
http://github.com/ceki/logback/commit/5c2b54f9c25b88c3afe1063fcee123b3b200d0c6

commit 5c2b54f9c25b88c3afe1063fcee123b3b200d0c6
Merge: dd63419 b572ad6
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Tue Oct 11 22:53:02 2011 +0200

    fixing LBCORE-225


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

commit dd63419d3e2a16c3d706a6a3d8cd37a90ecbcc9f
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Tue Oct 11 22:51:25 2011 +0200

    fixing LBCORE-225

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 97a7258..e6790a2 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
@@ -80,6 +80,7 @@ public abstract class SMTPAppenderBase<E> extends AppenderBase<E> {
 
   String username;
   String password;
+  String localhost;
 
   private String charsetEncoding = "UTF-8";
 
@@ -117,6 +118,10 @@ public abstract class SMTPAppenderBase<E> extends AppenderBase<E> {
     }
     props.put("mail.smtp.port", Integer.toString(smtpPort));
 
+    if(localhost != null) {
+      props.put("mail.smtp.localhost", localhost);
+    }
+
     LoginAuthenticator loginAuthenticator = null;
 
     if (username != null) {
@@ -128,7 +133,7 @@ public abstract class SMTPAppenderBase<E> extends AppenderBase<E> {
       addError("Both SSL and StartTLS cannot be enabled simultaneously");
     } else {
       if (isSTARTTLS()) {
-        //props.setProperty("mail.smtp.auth", "true");
+        // see also http://jira.qos.ch/browse/LBCORE-225
         props.put("mail.smtp.starttls.enable", "true");
       }
       if (isSSL()) {
@@ -445,6 +450,24 @@ public abstract class SMTPAppenderBase<E> extends AppenderBase<E> {
     return smtpPort;
   }
 
+  public String getLocalhost() {
+    return localhost;
+  }
+
+  /**
+   * Set the "mail.smtp.localhost" property to the value passed as parameter to
+   * this method.
+   *
+   * <p>Useful in case the hostname for the client host is not fully qualified
+   * and as a consequence the SMTP server rejects the clients HELO/EHLO command.
+   * </p>
+   *
+   * @param localhost
+   */
+  public void setLocalhost(String localhost) {
+    this.localhost = localhost;
+  }
+
   public CyclicBufferTracker<E> getCyclicBufferTracker() {
     return cbTracker;
   }
diff --git a/logback-site/src/site/pages/manual/appenders.html b/logback-site/src/site/pages/manual/appenders.html
index 72838df..4334f4e 100644
--- a/logback-site/src/site/pages/manual/appenders.html
+++ b/logback-site/src/site/pages/manual/appenders.html
@@ -1775,10 +1775,9 @@ public interface TriggeringPolicy<E> extends LifeCycle {
 
           <p>By default, this option is set to "%logger{20} - %m".</p>
         </td>
+        
       </tr>
       <tr class="alt">
-
-
         <td><b><span class="option">discriminator</span></b></td>
         <td><code><a href="../xref/ch/qos/logback/core/sift/Discriminator.html">Discriminator</a></code></td>
         <td>
@@ -1903,6 +1902,21 @@ public interface TriggeringPolicy<E> extends LifeCycle {
       </tr>
 
 
+      <tr class="alt">
+        <td><b>localhost</b></td>
+        <td><code>String</code></td>
+        <td>In case the hostname of the SMTP client is not properly
+        configured, e.g. if the client hostname is not fully
+        qualified, certain SMTP servers may reject the HELO/EHLO
+        commands sent by the client. To overcome this issue, you may
+        set the value of the <span class="option">localhost</span>
+        property to the fully qualified name of the client host. See
+        also the "mail.smtp.localhost" property in the documentation
+        for the <a
+        href="http://javamail.kenai.com/nonav/javadocs/com/sun/mail/smtp/package-summary.html">com.sun.mail.smtp</a>
+        package.</td>
+      </tr>
+
 		</table>		
 		
 		<p>The <code>SMTPAppender</code> keeps only the last 256 logging
diff --git a/logback-site/src/site/pages/news.html b/logback-site/src/site/pages/news.html
index 5018b38..f7f8b6a 100644
--- a/logback-site/src/site/pages/news.html
+++ b/logback-site/src/site/pages/news.html
@@ -42,12 +42,19 @@
     <code>CopyOnWriteArrayList</code> instead of the apparently buggy
     <code>ReadWriteLock</code>.</p>
 
+    <p>In STARTTLS mode, "mail.smtp.auth" property is no longer set
+    automatically. This fixes <a
+    href="http://jira.qos.ch/browse/LBCORE-225">LBCORE-225</a>
+    reported by Mark Woon.</p>
+
     <p>Fixed infinitely recursive calls in
     <code>AccessConverter#addError</code> methods as reported in <a
     href="http://jira.qos.ch/browse/LBACCESS-25">LBACCESS-25</a> by
     Pierre Queinnec.
     </p>
 
+
+
     <h3>September 21st, 2011 - Release of version 0.9.30</h3>
 
     <p>Archive removal can now deal with prolonged periods of

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

commit da07dc15ebb09c1a882be2596ec1b0cecb1377ab
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Fri Oct 7 10:19:33 2011 +0200

    minor edits

diff --git a/logback-core/src/main/java/ch/qos/logback/core/util/StatusPrinter.java b/logback-core/src/main/java/ch/qos/logback/core/util/StatusPrinter.java
index 2794a22..41709a5 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/util/StatusPrinter.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/util/StatusPrinter.java
@@ -37,14 +37,24 @@ public class StatusPrinter {
   public static void setPrintStream(PrintStream printStream) {
     ps = printStream;
   }
-  
+
   /**
    * Print the contents of the context statuses, but only if they contain
    * warnings or errors.
-   * 
+   *
    * @param context
    */
   public static void printInCaseOfErrorsOrWarnings(Context context) {
+    printInCaseOfErrorsOrWarnings(context, 0);
+  }
+
+  /**
+   * Print the contents of the context status, but only if they contain
+   * warnings or errors occurring later then the threshold.
+   *
+   * @param context
+   */
+  public static void printInCaseOfErrorsOrWarnings(Context context, long threshold) {
     if (context == null) {
       throw new IllegalArgumentException("Context argument cannot be null");
     }
@@ -55,8 +65,8 @@ public class StatusPrinter {
           + "\" has no status manager");
     } else {
       StatusChecker sc = new StatusChecker(context);
-      if (sc.getHighestLevel(0) >= ErrorStatus.WARN) {
-        print(sm);
+      if (sc.getHighestLevel(threshold) >= ErrorStatus.WARN) {
+        print(sm, threshold);
       }
     }
   }
@@ -64,7 +74,7 @@ public class StatusPrinter {
   /**
    * Print the contents of the context statuses, but only if they contain
    * errors.
-   * 
+   *
    * @param context
    */
   public static void printIfErrorsOccured(Context context) {
@@ -86,7 +96,7 @@ public class StatusPrinter {
 
   /**
    * Print the contents of the context's status data.
-   * 
+   *
    * @param context
    */
   public static void print(Context context) {
@@ -128,7 +138,7 @@ public class StatusPrinter {
     buildStrFromStatusList(sb, statusList);
     ps.println(sb.toString());
   }
-  
+
 
   private static void buildStrFromStatusList(StringBuilder sb, List<Status> statusList) {
     if(statusList == null)
@@ -141,7 +151,7 @@ public class StatusPrinter {
 //  private static void buildStrFromStatusManager(StringBuilder sb, StatusManager sm) {
 //  }
 
-  
+
   private static void appendThrowable(StringBuilder sb, Throwable t) {
     String[] stringRep = ThrowableToStringArray.convert(t);
 
diff --git a/logback-examples/src/main/java/chapters/configuration/MyApp3.java b/logback-examples/src/main/java/chapters/configuration/MyApp3.java
index 3db4562..dc3d14e 100644
--- a/logback-examples/src/main/java/chapters/configuration/MyApp3.java
+++ b/logback-examples/src/main/java/chapters/configuration/MyApp3.java
@@ -30,19 +30,19 @@ public class MyApp3 {
 
   public static void main(String[] args) {
     // assume SLF4J is bound to logback in the current environment
-    LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
+    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
 
     try {
       JoranConfigurator configurator = new JoranConfigurator();
-      configurator.setContext(lc);
-      // the context was probably already configured by default configuration
-      // rules
-      lc.reset();
+      configurator.setContext(context);
+      // Call context.reset() to clear any previous configuration, e.g. default
+      // configuration. For multi-step configuration, omit calling context.reset().
+      context.reset();
       configurator.doConfigure(args[0]);
     } catch (JoranException je) {
       // StatusPrinter will handle this
     }
-    StatusPrinter.printInCaseOfErrorsOrWarnings(lc);
+    StatusPrinter.printInCaseOfErrorsOrWarnings(context);
 
     logger.info("Entering application.");
 
diff --git a/logback-site/src/site/pages/manual/configuration.html b/logback-site/src/site/pages/manual/configuration.html
index 9df3117..b7aa29a 100644
--- a/logback-site/src/site/pages/manual/configuration.html
+++ b/logback-site/src/site/pages/manual/configuration.html
@@ -480,12 +480,12 @@ public class Foo {
    <h3><a name="joranDirectly" href="#joranDirectly">Invoking
    <code>JoranConfigurator</code> directly</a></h3>
 
-   <p>Logback relies on a configuration library called Joran which is
-   part of logback-core. Logback's default configuration mechanism
-   invokes <code>JoranConfigurator</code> on the default configuration
-   file it finds on the class path. If you wish to
-   override logback's default configuration mechanism for whatever reason, you can do so
-   by invoking <code>JoranConfigurator</code> directly. The next
+   <p>Logback relies on a configuration library called Joran, part of
+   logback-core. Logback's default configuration mechanism invokes
+   <code>JoranConfigurator</code> on the default configuration file it
+   finds on the class path. If you wish to override logback's default
+   configuration mechanism for whatever reason, you can do so by
+   invoking <code>JoranConfigurator</code> directly. The next
    application, <em>MyApp3</em>, invokes JoranConfigurator on a
    configuration file passed as a parameter.</p>
    
@@ -508,19 +508,19 @@ public class MyApp3 {
 
   public static void main(String[] args) {
     // assume SLF4J is bound to logback in the current environment
-    <b>LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();</b>
+    <b>LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();</b>
     
     <b>try {
       JoranConfigurator configurator = new JoranConfigurator();
-      configurator.setContext(lc);
-      // the context was probably already configured by default configuration 
-      // rules
-      lc.reset(); 
+      configurator.setContext(context);
+      // Call context.reset() to clear any previous configuration, e.g. default 
+      // configuration. For multi-step configuration, omit calling context.reset().
+      context.reset(); 
       configurator.doConfigure(args[0]);
     } catch (JoranException je) {
       // StatusPrinter will handle this
     }
-    StatusPrinter.printInCaseOfErrorsOrWarnings(lc);</b>
+    StatusPrinter.printInCaseOfErrorsOrWarnings(context);</b>
 
     logger.info("Entering application.");
 
@@ -536,8 +536,8 @@ public class MyApp3 {
    context, and then finally asks the configurator to configure the
    context using the configuration file passed as a parameter to the
    application. Internal status data is printed in case of warnings or
-   errors.
-   </p>   
+   errors. Note that for multi-step configuration,
+   <code>context.reset()</code> invocation should be omitted.</p>
 
    <h3><a name="viewingStatusMessages"
    href="#viewingStatusMessages">Viewing status messages</a>

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

Summary of changes:
 .../ch/qos/logback/core/net/SMTPAppenderBase.java  |   25 +++++++++++++++++-
 .../ch/qos/logback/core/util/StatusPrinter.java    |   26 ++++++++++++-----
 .../main/java/chapters/configuration/MyApp3.java   |   12 ++++----
 logback-site/src/site/pages/manual/appenders.html  |   18 +++++++++++-
 .../src/site/pages/manual/configuration.html       |   28 ++++++++++----------
 logback-site/src/site/pages/news.html              |    5 +++
 6 files changed, 83 insertions(+), 31 deletions(-)


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


More information about the logback-dev mailing list