[slf4j-dev] svn commit: r1312 - in slf4j/trunk: jcl104-over-slf4j jul-to-slf4j/src/main/java/org/slf4j/bridge slf4j-site/src/site/pages

ceki at slf4j.org ceki at slf4j.org
Fri Apr 17 16:14:46 CEST 2009


Author: ceki
Date: Fri Apr 17 16:14:46 2009
New Revision: 1312

Modified:
   slf4j/trunk/jcl104-over-slf4j/   (props changed)
   slf4j/trunk/jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java
   slf4j/trunk/slf4j-site/src/site/pages/news.html

Log:
- fixed bug 108

Modified: slf4j/trunk/jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java
==============================================================================
--- slf4j/trunk/jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java	(original)
+++ slf4j/trunk/jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java	Fri Apr 17 16:14:46 2009
@@ -99,8 +99,8 @@
    * <p>
    * This handler will redirect jul logging to SLF4J. However, only logs enabled
    * in j.u.l. will be redirected. For example, if a log statement invoking a
-   * j.u.l. logger disabled that statement, by definition, will <em>not</em> reach
-   * any SLF4JBridgeHandler instance and cannot be redirected. 
+   * j.u.l. logger disabled that statement, by definition, will <em>not</em>
+   * reach any SLF4JBridgeHandler instance and cannot be redirected.
    */
   public static void install() {
     LogManager.getLogManager().getLogger("").addHandler(
@@ -112,9 +112,9 @@
    * {@link #install()}.
    * 
    * @throws SecurityException
-   *                 A <code>SecurityException</code> is thrown, if a security
-   *                 manager exists and if the caller does not have
-   *                 LoggingPermission("control").
+   *           A <code>SecurityException</code> is thrown, if a security manager
+   *           exists and if the caller does not have
+   *           LoggingPermission("control").
    */
   public static void uninstall() throws SecurityException {
     java.util.logging.Logger rootLogger = LogManager.getLogManager().getLogger(
@@ -232,8 +232,8 @@
    * about discarding log statements.
    * 
    * @param record
-   *                Description of the log event. A null record is silently
-   *                ignored and is not published.
+   *          Description of the log event. A null record is silently ignored
+   *          and is not published.
    */
   public void publish(LogRecord record) {
     // Silently ignore null records.
@@ -244,9 +244,11 @@
     Logger slf4jLogger = getSLF4JLogger(record);
     String message = record.getMessage(); // can be null!
     // this is a check to avoid calling the underlying logging system
-    // with a null message
+    // with a null message. While it is legitimate to invoke j.u.l. with
+    // a null message, other logging frameworks do not support this.
+    // see also http://bugzilla.slf4j.org/show_bug.cgi?id=108
     if (message == null) {
-      return;
+      message = "";
     }
     if (slf4jLogger instanceof LocationAwareLogger) {
       callLocationAwareLogger((LocationAwareLogger) slf4jLogger, record);

Modified: slf4j/trunk/slf4j-site/src/site/pages/news.html
==============================================================================
--- slf4j/trunk/slf4j-site/src/site/pages/news.html	(original)
+++ slf4j/trunk/slf4j-site/src/site/pages/news.html	Fri Apr 17 16:14:46 2009
@@ -25,6 +25,16 @@
   announce</a> mailing list.
   </p>
 
+  <hr noshade="noshade" size="1"/>
+
+  <h3>April x, 2009 - Release of SLF4J 1.5.7</h3>
+
+  <p><code>SLF4JBridgeHandler</code> will no longer ignore log records
+  with an empty message. This fixes <a
+  href="http://bugzilla.slf4j.org/show_bug.cgi?id=108">bug 108</a>
+  reported by Pepijn Van Eeckhoudt and independently by Dan Lewis.
+  </p>
+
 
   <hr noshade="noshade" size="1"/>
 



More information about the slf4j-dev mailing list