Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1354

No configuration reload is triggered under Windows when replacing the configuration file with one that has older last modified date.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.5
    • 2.6
    • Configurators
    • 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.

      Attachments

        Activity

          People

            ggregory Gary D. Gregory
            akku-rat Arkadiusz Adolph
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: