[
https://issues.apache.org/jira/browse/LOG4J2-912?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary Gregory resolved LOG4J2-912.
---------------------------------
Resolution: Fixed
In git master.
> XML configuration does not report full error message for XInclude parser
> configuration problems
> -----------------------------------------------------------------------------------------------
>
> Key: LOG4J2-912
> URL: https://issues.apache.org/jira/browse/LOG4J2-912
> Project: Log4j 2
> Issue Type: Bug
> Components: Configurators
> Affects Versions: 2.1
> Environment: 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"
> Reporter: Gary Gregory
> Assignee: Gary Gregory
> Fix For: 2.2
>
>
> 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:
> {noformat}
> 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);
> }
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]