Return-Path: X-Original-To: apmail-logging-commits-archive@minotaur.apache.org Delivered-To: apmail-logging-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A5E3A10FFF for ; Wed, 9 Jul 2014 17:56:10 +0000 (UTC) Received: (qmail 84293 invoked by uid 500); 9 Jul 2014 17:56:10 -0000 Delivered-To: apmail-logging-commits-archive@logging.apache.org Received: (qmail 84264 invoked by uid 500); 9 Jul 2014 17:56:10 -0000 Mailing-List: contact commits-help@logging.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@logging.apache.org Delivered-To: mailing list commits@logging.apache.org Received: (qmail 84255 invoked by uid 99); 9 Jul 2014 17:56:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2014 17:56:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2014 17:56:09 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 54DB323889CB; Wed, 9 Jul 2014 17:55:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@logging.apache.org From: ggregory@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140709175544.54DB323889CB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 @@ Update Jackson to 2.4.1. + + Some exceptions are not logged when configuration problems are detected. +