ofbiz-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doo...@apache.org
Subject svn commit: r1482000 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/container/ContainerLoader.java
Date Mon, 13 May 2013 18:01:47 GMT
Author: doogie
Date: Mon May 13 18:01:47 2013
New Revision: 1482000

URL: http://svn.apache.org/r1482000
Log:
FIX/FEATURE: When shutting down, make certain to close down log4j as
well.  This will ensure that any asynchronous logs have finished
writing to disk, or to the console.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/container/ContainerLoader.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/container/ContainerLoader.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/container/ContainerLoader.java?rev=1482000&r1=1481999&r2=1482000&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/container/ContainerLoader.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/container/ContainerLoader.java Mon May 13
18:01:47 2013
@@ -27,6 +27,9 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.log4j.Logger;
+import org.apache.log4j.Appender;
+
 import org.ofbiz.base.component.ComponentConfig;
 import org.ofbiz.base.start.Config;
 import org.ofbiz.base.start.StartupException;
@@ -265,6 +268,11 @@ public class ContainerLoader implements 
                     Debug.logInfo("Stopped container " + container.getName(), module);
                 }
             }
+            Enumeration<Appender> en = Logger.getRootLogger().getAllAppenders();
+            while (en.hasMoreElements()) {
+                Appender appender = en.nextElement();
+                appender.close();
+            }
         }
     }
 }



Mime
View raw message