Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.5
-
None
Description
Due to the way Windows handles the date modified attribute on copied or overwritten files log4j doesn't pick up the changes and doesn't reload the configuration.
Example:
The currently used log4j configuration file (date modified = 2pm) is replaced at 3pm by another configuration file (date modified= 1pm). Under Windows, the date modified of this file is now 1pm. This will not trigger log4j configuration to reload, since the new date is smaller than the original.
Maybe changing
if (lastModfied > fileMonitor.lastModified) {
to
if (lastModfied != fileMonitor.lastModified) {
in in org.apache.logging.log4j.core.util.WatchManager.WatchWorker.run() could be an easy solution for this.