working around a memory leak in commons-logging. And they don't even acknowledge that it's a bug. Sigh.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2868 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-04-06 14:20:13 +00:00
1 parent 26ee3433ed
commit 3bfa8af569
3 files changed
+14 -1

No files matched your search

+5 -1
View File
@@ -32,6 +32,7 @@ import java.util.logging.Logger;
* @author Kohsuke Kawaguchi
*/
public class WebAppMain implements ServletContextListener {
private final RingBufferLogHandler handler = new RingBufferLogHandler();
/**
* Creates the sole instance of {@link Hudson} and register it to the {@link ServletContext}.
@@ -116,7 +117,6 @@ public class WebAppMain implements ServletContextListener {
* Installs log handler to monitor all Hudson logs.
*/
private void installLogger() {
RingBufferLogHandler handler = new RingBufferLogHandler();
Hudson.logRecords = handler.getView();
Logger.getLogger("hudson").addHandler(handler);
}
@@ -168,5 +168,9 @@ public class WebAppMain implements ServletContextListener {
Hudson instance = Hudson.getInstance();
if(instance!=null)
instance.cleanUp();
// Logger is in the system classloader, so if we don't do this
// the whole web app will never be undepoyed.
Logger.getLogger("hudson").removeHandler(handler);
}
}