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

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

Github user alanachtenberg commented on the pull request:

    https://github.com/apache/logging-log4j2/pull/25#issuecomment-191348199
  
    I agree it would be nice to automatically pick up xincluded files; It would 
good if it was a "just works" solution for the end user without having to 
select files to monitor, but that solution would not be very portable to the 
other file formats. If specifying a list of files is deemed acceptable this 
would be easy to reproduce for json and probably YAML(I have no experience with 
it).
    
    Also being able to specify the files gives the user alot more power. In my 
case what if I only want to monitor the log4j-xinclude-loggers.xml(changed 
often) for changes and not the appenders(changed rarely, usually with a new 
release if at all) to reduce overhead with the checks. Secondly a user could 
enable and disable monitoring of files at anytime since the main configuration 
will always be monitored. Lastly I think there could be some good use cases for 
monitoring non log4j2 files for changes (Especially when you consider 
extensions or plugins of log4j2) . For example an application that uses a 
single generic configuration/properties file(client accessible) for application 
wide configuration could set some properties to be used in the logging system 
initialization.
    
    I am a happy camper either way if i can get reconfiguration based on the 
xincluded files :)
    
    Thanks for the feedback and let me know if you find anything with regards 
to a "java 8 way". I looked into where the xinclude is processed and it seemed 
it would be difficult to retrieve the files without hacking up the xml code. 
However, I have relatively little experience and you might see a better 
solution than me.
    
    -Alan


> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to