MichaelMorrisEst commented on code in PR #3501:
URL: https://github.com/apache/logging-log4j2/pull/3501#discussion_r2077846745
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/config/AbstractConfiguration.java:
##########
@@ -323,10 +325,19 @@ public void start() {
LOGGER.info("Starting configuration {}...", this);
this.setStarting();
if (watchManager.getIntervalSeconds() >= 0) {
- LOGGER.info(
- "Start watching for changes to {} every {} seconds",
- getConfigurationSource(),
- watchManager.getIntervalSeconds());
+ if (uris != null && uris.size() > 0) {
+ LOGGER.info(
+ "Start watching for changes to {} and {} every {}
seconds",
+ getConfigurationSource(),
+ uris,
+ watchManager.getIntervalSeconds());
+ watchMonitorUris();
+ } else {
+ LOGGER.info(
+ "Start watching for changes to {} every {} seconds",
+ getConfigurationSource(),
+ watchManager.getIntervalSeconds());
+ }
Review Comment:
Hi @vy
The reason I did not put it in initializeWatchers() is because
initializeWatchers() is called before the elements are read. The top level
attributes (including monitorInterval) have been read at this stage and can
therefore be used, but the elements (including monitorUris) have not been.
Would it be ok to move invoking watchMonitorUris() to intialization() which
is earlier than here, but after the elements have been read? This would avoid
having to read the monitorUri element earlier and separately from the other
elements.
I can move it to initializeWatchers() either if you still prefer that, and
add code to read the monitorUri element separately to the other elements, but I
think the above would be cleaner in the code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]