commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject svn commit: r476774 - /jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Log4JLogger.java
Date Sun, 19 Nov 2006 08:57:52 GMT
Author: skitching
Date: Sun Nov 19 00:57:51 2006
New Revision: 476774

URL: http://svn.apache.org/viewvc?view=rev&rev=476774
Log:
Handle null log4j logger param to constructor better than just causing NullPointerException.
Thanks to Lilianne E. Blaze for the patch; see jira LOGGING-111.

Modified:
    jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Log4JLogger.java

Modified: jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Log4JLogger.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Log4JLogger.java?view=diff&rev=476774&r1=476773&r2=476774
==============================================================================
--- jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Log4JLogger.java
(original)
+++ jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/Log4JLogger.java
Sun Nov 19 00:57:51 2006
@@ -109,9 +109,14 @@
         this.logger = getLogger();
     }
 
-    /** For use with a log4j factory.
+    /** 
+     * For use with a log4j factory.
      */
     public Log4JLogger(Logger logger ) {
+        if (logger == null) {
+            throw new IllegalArgumentException(
+                "Warning - null logger in constructor; possible log4j misconfiguration.");
+        }
         this.name = logger.getName();
         this.logger=logger;
     }



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


Mime
View raw message