The description of the getLogger () LogManager method says the following:
"(...) The logger associated with the String name can be collected at any time if there is no strong reference to the Logger. The caller of this method must check the return value for null in order to handle it correctly when the Logger was garbage collected."
How is it possible that the GC can erase Logger since the LogManager must support all references to all Loggers in order to be able to resolve Loggers names?
Isnβt it so strange that the Java API allows the situation that at the beginning of my application I create and configure my Loggers, but forget to save refrences, and later, if I use Logger.getLogger ('someName') I will get a new one, by default one the installation of my Loggers that I installed?
Protechnologia.pl
source share