commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject svn commit: r394649 - /jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java
Date Mon, 17 Apr 2006 09:16:30 GMT
Author: skitching
Date: Mon Apr 17 02:16:28 2006
New Revision: 394649

URL: http://svn.apache.org/viewcvs?rev=394649&view=rev
Log:
* Log the classloader that really loaded the adapter class, rather than the one
  we called loadClass on.
* Remove some debug code accidentally committed recently.

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

Modified: jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java?rev=394649&r1=394648&r2=394649&view=diff
==============================================================================
--- jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java
(original)
+++ jakarta/commons/proper/logging/trunk/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java
Mon Apr 17 02:16:28 2006
@@ -967,7 +967,10 @@
                     + objectId(currentCL));
             try {
                 if (isDiagnosticsEnabled()) {
-                    // show exactly where we are loading this class from.
+                    // Show the location of the first occurrence of the .class file
+                    // in the classpath. This is the location that ClassLoader.loadClass
+                    // will load the class from -- unless the classloader is doing
+                    // something weird. 
                     URL url;
                     String resourceName = logAdapterClassName.replace('.', '/') + ".class";
                     if (currentCL != null) {
@@ -982,18 +985,6 @@
                         logDiagnostic("Class '" + logAdapterClassName + "' was found at '"
+ url + "'");
                     }
                 }
-                
-                // hack
-                {
-                    String l4jCategory = "org.apache.log4j.Category";
-                    String l4jResource = l4jCategory.replace('.', '/') + ".class";
-                    URL l4jUrl = currentCL.getResource(l4jResource);
-                    if (l4jUrl == null) {
-                        logDiagnostic("log4j not found:" + l4jResource);
-                    } else {
-                        logDiagnostic("log4j found:" + l4jUrl);
-                    }
-                }
 
                 Class c = null;
                 try {
@@ -1030,6 +1021,7 @@
                         break;
                     }
                 }
+                
                 constructor = c.getConstructor(logConstructorSignature);
                 Object o = constructor.newInstance(params);
 
@@ -1042,7 +1034,6 @@
                     logAdapter = (Log) o;
                     break;
                 }
-            
                 
                 // Oops, we have a potential problem here. An adapter class
                 // has been found and its underlying lib is present too, but
@@ -1127,7 +1118,7 @@
             
             logDiagnostic(
                 "Log adapter '" + logAdapterClassName 
-                + "' from classloader " + objectId(currentCL)
+                + "' from classloader " + objectId(logAdapterClass.getClassLoader())
                 + " has been selected for use.");
         }
         



---------------------------------------------------------------------
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