Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8060132 Handlers configured on abstract nodes in logging.properties are not always properly closed
  3. JDK-8175264

Release Note: Loggers with handlers configured from the logging.properties configuration file will not be garbage collected until LogManager.reset is called.

    XMLWordPrintable

Details

    Description

      When a logger has a handler configured in the logging configuration file (using the `<logger>.handlers` property), a reference to that logger will be internally kept by the LogManager until `LogManager.reset()` is called, in order to ensure that the associated handlers are properly closed on reset. As a consequence, such loggers won't be garbage collected until `LogManager.reset()` is called. An application that needs to allow garbage collection of these loggers before reset is called can revert to the old behaviour by additionally specifying `<logger>.handlers.ensureCloseOnReset=false` in the logging configuration file. Note however that doing so will reintroduce the resource leak that JDK-8060132 is fixing. Such an application must therefore take the responsibility of keeping the logger alive as long as it is needed, and close any handler attached to it before the logger gets garbage collected. See LogManager API documentation for more details.

      Attachments

        Activity

          People

            dfuchs Daniel Fuchs
            dfuchs Daniel Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: