logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1609251 - in /logging/log4j/log4j2/trunk: log4j-core/src/main/java/org/apache/logging/log4j/core/config/ log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ log4j-core/src/main/java/org/apache/logging/log4j/core/con...
Date Wed, 09 Jul 2014 17:55:44 GMT
Author: ggregory
Date: Wed Jul  9 17:55:43 2014
New Revision: 1609251

URL: http://svn.apache.org/r1609251
Log:
[LOG4J2-707] Some exceptions are not logged when configuration problems are detected.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java
    logging/log4j/log4j2/trunk/src/changes/changes.xml

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java?rev=1609251&r1=1609250&r2=1609251&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java
Wed Jul  9 17:55:43 2014
@@ -139,9 +139,9 @@ public abstract class AbstractConfigurat
                 try {
                     // Cause the class to be initialized if it isn't already.
                     Loader.initializeClass(type.getPluginClass().getName(), type.getPluginClass().getClassLoader());
-                } catch (final Exception ex) {
-                    LOGGER.error("Unable to initialize {} due to {}: {}", type.getPluginClass().getName(),
-                            ex.getClass().getSimpleName(), ex.getMessage());
+                } catch (final Exception e) {
+                    LOGGER.error("Unable to initialize {} due to {}", type.getPluginClass().getName(),
e.getClass()
+                            .getSimpleName(), e);
                 }
             }
         }
@@ -728,16 +728,16 @@ public abstract class AbstractConfigurat
         if (Map.class.isAssignableFrom(clazz)) {
             try {
                 return createPluginMap(node, clazz);
-            } catch (final Exception ex) {
-                LOGGER.warn("Unable to create Map for {} of class {}", type.getElementName(),
clazz);
+            } catch (final Exception e) {
+                LOGGER.warn("Unable to create Map for {} of class {}", type.getElementName(),
clazz, e);
             }
         }
 
         if (Collection.class.isAssignableFrom(clazz)) {
             try {
                 return createPluginCollection(node, clazz);
-            } catch (final Exception ex) {
-                LOGGER.warn("Unable to create List for {} of class {}", type.getElementName(),
clazz);
+            } catch (final Exception e) {
+                LOGGER.warn("Unable to create List for {} of class {}", type.getElementName(),
clazz, e);
             }
         }
 

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java?rev=1609251&r1=1609250&r2=1609251&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
Wed Jul  9 17:55:43 2014
@@ -141,7 +141,7 @@ public abstract class ConfigurationFacto
                                 ordered.add(new WeightedFactory(weight, clazz));
                             }
                         } catch (final Exception ex) {
-                            LOGGER.warn("Unable to add class {}", type.getPluginClass());
+                            LOGGER.warn("Unable to add class {}", type.getPluginClass(),
ex);
                         }
                     }
                     for (final WeightedFactory wf : ordered) {

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java?rev=1609251&r1=1609250&r2=1609251&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
Wed Jul  9 17:55:43 2014
@@ -301,7 +301,7 @@ public class ResolverUtil {
             loadImplementationsInJar(test, parent, jarFile.getPath(), jarStream);
         } catch (final FileNotFoundException ex) {
             LOGGER.error("Could not search jar file '" + jarFile + "' for classes matching
criteria: " + test
-                    + " file not found");
+                    + " file not found", ex);
         } catch (final IOException ioe) {
             LOGGER.error("Could not search jar file '" + jarFile + "' for classes matching
criteria: " + test
                     + " due to an IOException", ioe);
@@ -382,8 +382,7 @@ public class ResolverUtil {
                 }
             }
         } catch (final Throwable t) {
-            LOGGER.warn("Could not examine class '" + fqn + "' due to a " +
-                t.getClass().getName() + " with message: " + t.getMessage());
+            LOGGER.warn("Could not examine class '" + fqn, t);
         }
     }
 

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java?rev=1609251&r1=1609250&r2=1609251&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java
Wed Jul  9 17:55:43 2014
@@ -106,7 +106,7 @@ public class XmlConfiguration extends Ab
             LOGGER.warn("The DocumentBuilderFactory [{}] does not support the feature [{}].",
factory,
                     XINCLUDE_FIXUP_BASE_URIS, e);
         } catch (@SuppressWarnings("ErrorNotRethrown") final AbstractMethodError err) {
-            LOGGER.warn("The DocumentBuilderFactory is out of date and does not support setFeature:
{}", factory);
+            LOGGER.warn("The DocumentBuilderFactory is out of date and does not support setFeature:
{}", factory, err);
         }
         try {
             factory.setFeature(XINCLUDE_FIXUP_LANGUAGE, true);
@@ -114,7 +114,7 @@ public class XmlConfiguration extends Ab
             LOGGER.warn("The DocumentBuilderFactory [{}] does not support the feature [{}].",
factory,
                     XINCLUDE_FIXUP_LANGUAGE, e);
         } catch (@SuppressWarnings("ErrorNotRethrown") final AbstractMethodError err) {
-            LOGGER.warn("The DocumentBuilderFactory is out of date and does not support setFeature:
{}", factory);
+            LOGGER.warn("The DocumentBuilderFactory is out of date and does not support setFeature:
{}", factory, err);
         }
     }
 
@@ -180,7 +180,7 @@ public class XmlConfiguration extends Ab
             try {
                 is = Loader.getResourceAsStream(schema, XmlConfiguration.class.getClassLoader());
             } catch (final Exception ex) {
-                LOGGER.error("Unable to access schema {}", this.schema);
+                LOGGER.error("Unable to access schema {}", this.schema, ex);
             }
             if (is != null) {
                 final Source src = new StreamSource(is, LOG4J_XSD);

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1609251&r1=1609250&r2=1609251&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Wed Jul  9 17:55:43 2014
@@ -69,6 +69,9 @@
       <action issue="LOG4J2-689" dev="ggregory" type="update">
         Update Jackson to 2.4.1.
       </action>
+      <action issue="LOG4J2-707" dev="ggregory" type="fix">
+        Some exceptions are not logged when configuration problems are detected.
+      </action>
     </release>
     <release version="2.0-rc2" date="2014-06-21" description="Bug fixes and enhancements">
       <action issue="LOG4J2-675" dev="rpopma" type="add">



Mime
View raw message