-
Sub-task
-
Resolution: Delivered
-
P4
-
9
-
Verified
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.