Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.1
-
None
-
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T16:58:10-04:00)
Maven home: C:\Java\apache-maven-3.2.3
Java version: 1.7.0_71, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_71\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T16:58:10-04:00) Maven home: C:\Java\apache-maven-3.2.3 Java version: 1.7.0_71, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.7.0_71\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Description
XML configuration does not report full error message for XInclude parser configuration problems.
Logging messages are missing {}s in the message format strings.
Diff for fix:
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java index 8962443..c094137 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/xml/XmlConfiguration.java @@ -96,27 +96,27 @@ // -DLog4j.XInclude=true factory.setXIncludeAware(true); } catch (final UnsupportedOperationException e) { - LOGGER.warn("The DocumentBuilderFactory does not support XInclude: {}", factory, e); + LOGGER.warn("The DocumentBuilderFactory [{}] does not support XInclude: {}", factory, e); } catch (@SuppressWarnings("ErrorNotRethrown") final AbstractMethodError err) { - LOGGER.warn("The DocumentBuilderFactory is out of date and does not support XInclude: {}", factory, err); + LOGGER.warn("The DocumentBuilderFactory [{}] is out of date and does not support XInclude: {}", factory, err); } try { // Alternative: We could specify all features and values with system properties like: // -DLog4j.DocumentBuilderFactory.Feature="http://apache.org/xml/features/xinclude/fixup-base-uris true" factory.setFeature(XINCLUDE_FIXUP_BASE_URIS, true); } catch (final ParserConfigurationException e) { - LOGGER.warn("The DocumentBuilderFactory [{}] does not support the feature [{}].", factory, + 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, err); + LOGGER.warn("The DocumentBuilderFactory [{}] is out of date and does not support setFeature: {}", factory, err); } try { factory.setFeature(XINCLUDE_FIXUP_LANGUAGE, true); } catch (final ParserConfigurationException e) { - LOGGER.warn("The DocumentBuilderFactory [{}] does not support the feature [{}].", factory, + 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, err); + LOGGER.warn("The DocumentBuilderFactory [{}] is out of date and does not support setFeature: {}", factory, err); } }