JDK-4811930 : RFE: Cannot remove Loggers from LogManager
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util.logging
  • Affected Version: 1.4.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2003-02-03
  • Updated: 2009-09-02
  • Resolved: 2009-09-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7Resolved
Related Reports
Duplicate :  
Relates :  
Description
Name: rmT116609			Date: 02/03/2003


DESCRIPTION OF THE PROBLEM :
We need a way to remove Logger objects from the LogManager when they are no longer needed.  There is no way to remove a Logger from LogManager and in reviewing the source code LogManager does not use weak references - it uses a simple Hashtable.  Furthermore, the comment on LogManager.addLogger is misleading as it states that the implementation "may" use weak references.

We create numerous Logger objects on our server and we need a way to clean them out when a session used by that logger is terminated.  Using separate Logger objects gives us the ability to have different logging levels for different
sessions.  For example, if a user is having a problem I want to be ablt turn debugging on for their sesson and not all sessions on the server.


(Review ID: 180707) 
======================================================================

Comments
EVALUATION Bug 4811930 asks for an API to remove a named logger from a LogManager object. The bug also correctly points out that the original logging implementation did not use a weak reference from a LogManager object to a logger object. With the pair of fixes for 6274920 and 6498300, the original logging implementation has been fixed. The fixes for 6274920 and 6498300 have been in JDK7 since JDK7-B12 and are in the process of being backported to the JDK6-Update train. A new API for removing a logger object from a LogManager object is not necessary now that 6274920 and 6498300 have been fixed. I am closing this bug as a duplicate of 6274920.
02-09-2009

EVALUATION This needs to be fixed for Dolphin. There are some details which are have to be determined though. If we allow to unregister a logger within LogManager then we have to decide what to do with the children of the logger. The internal structures including parent-child relationship between loggers exist in the LogManager. One way would be to unregister the whole subtree of loggers. Thiis way we could control the integrity of the internal structures. Another way would be to put all the responsibility of loggers unregistering on the users, requiring to delete the children loggers first. Then we could raise an exception when this condition was disobeyed.
05-09-2006

EVALUATION Would require an api change but possible ###@###.### 2003-07-24
24-07-2003