logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1301) Automatic reconfiguration with xml and xinclude
Date Wed, 02 Mar 2016 23:15:18 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-1301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15176689#comment-15176689
] 

ASF GitHub Bot commented on LOG4J2-1301:
----------------------------------------

Github user alanachtenberg commented on the pull request:

    https://github.com/apache/logging-log4j2/pull/25#issuecomment-191488100
  
    On the retrieval of xinclude files for the automatic watching route.
    
    I was trying out this neat little library for xml . https://github.com/jOOQ/jOOX 
    
    From their wiki.
    
    >  jOOX stands for Java Object Oriented XML. It is a simple wrapper for the org.w3c.dom
package, to allow for fluent XML document creation and manipulation where DOM is required
but too verbose. jOOX only wraps the underlying document and can be used to enhance DOM, not
as an alternative.
    
    Usage as follows works in my simple test program.
    `Document document = $(xmlFile).document();
                Match includeElements  = $(document).find("include");
                for (Element element : includeElements){
                    String includeFilePath = element.getAttribute("href");
                }`
    
    I can retrieve the include elements because the builder they use does not have xinclude
enabled by default. Therefore the include elements are not processed by the builder. Which
made me realize if we wanted to retrieve the included files we could parse the file for them
before enabling xinclude. It would require parsing the file twice(once to get the file names,
and once for actual configuration) which is not ideal however.


> Automatic reconfiguration with xml and xinclude
> -----------------------------------------------
>
>                 Key: LOG4J2-1301
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1301
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.3
>            Reporter: Alan Achtenberg
>         Attachments: GroupFileConfigurationMonitor.java, MyXmlConfiguration.java, MyXmlConfigurationFactory.java
>
>
> Automatic reconfiguration does not work with xinclude/xml.
> Modifying xinclude files is not detected as a file change on on the main config file
and as such it is not reconfigured when updates are made to files included with xinclude (ie.
log4j2-appenders.xml).
> Desired functionality would be to also listen for changes of files that are included
by main configuration file as well and update the configuration as needed.
> An alternative would be to allow user to specify additional files to monitor for changes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message