private void _cleanUpReleaseAllLoggers(List<Throwable> errors) { LOGGER.log(Level.FINE, "Releasing all loggers"); try { LogFactory.releaseAll(); } catch (OutOfMemoryError e) { // we should just propagate this, no point trying to log throw e; } catch (LinkageError e) { LOGGER.log(SEVERE, "Failed to release all loggers", e); // safe to ignore and continue for this one } catch (Throwable e) { LOGGER.log(SEVERE, "Failed to release all loggers", e); // save for later errors.add(e); } }
@Override public void releaseAll() { LogFactory.releaseAll(); }
/** * リソースを開放します。 */ public synchronized static void dispose() { LogFactory.releaseAll(); loggers.clear(); initialized = false; }
/** * リソースを開放します。 */ public synchronized static void dispose() { LogFactory.releaseAll(); loggers.clear(); initialized = false; }
/** * Resets the system property LogFactory looks at to find the correct LogFactory to return when a factory is requested and releases all instances. */ public static void resetInstance() { System.clearProperty("org.apache.commons.logging.LogFactory"); LogFactory.releaseAll(); }
public synchronized static void init() { if (!initialized) { LogFactory.releaseAll(); // Setup the delegating log System.setProperty("org.apache.commons.logging.Log", "org.apache.geronimo.genesis.logging.DelegatingLog"); // Make sure that Geronimo bootstrap logging does not clobber our logging System.setProperty("geronimo.bootstrap.logging.enabled", "false"); Log log = LogFactory.getLog(Logging.class); log.debug("Initialized"); initialized = true; } }
public synchronized static void init() { if (!initialized) { LogFactory.releaseAll(); // // FIXME: Need to move this back to the car-maven-plugin, need to revisit // all this mojo logging to JCL/Log4j muck... // // Setup the delegating log System.setProperty("org.apache.commons.logging.Log", "org.codehaus.mojo.pluginsupport.logging.DelegatingLog"); // Make sure that Geronimo bootstrap logging does not clobber our logging System.setProperty("geronimo.bootstrap.logging.enabled", "false"); Log log = LogFactory.getLog(Logging.class); log.debug("Initialized"); initialized = true; } }
public synchronized static void reset() { if (initialized) { Log log = LogFactory.getLog(Logging.class); log.debug("Resetting"); LogFactory.releaseAll(); // Restore a reasonable default log impl System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog"); // Make SimpleLog look more like Maven logs System.setProperty("org.apache.commons.logging.simplelog.showShortLogname", "false"); // Restore default Geornimo bootstrap behavior System.getProperties().remove("geronimo.bootstrap.logging.enabled"); initialized = false; } } }
private void _cleanUpReleaseAllLoggers(List<Throwable> errors) { LOGGER.log(Level.FINE, "Releasing all loggers"); try { LogFactory.releaseAll(); } catch (OutOfMemoryError e) { // we should just propagate this, no point trying to log throw e; } catch (LinkageError e) { LOGGER.log(SEVERE, "Failed to release all loggers", e); // safe to ignore and continue for this one } catch (Throwable e) { LOGGER.log(SEVERE, "Failed to release all loggers", e); // save for later errors.add(e); } }
public synchronized static void reset() { if (initialized) { Log log = LogFactory.getLog(Logging.class); log.debug("Resetting"); LogFactory.releaseAll(); // Restore a reasonable default log impl System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog"); // Make SimpleLog look more like Maven logs System.setProperty("org.apache.commons.logging.simplelog.showShortLogname", "false"); // Restore default Geornimo bootstrap behavior System.getProperties().remove("geronimo.bootstrap.logging.enabled"); initialized = false; } } }
/** * Creates an instance of the LogFactoryMock and sets the system property LogFactory looks at to find the correct LogFactory to return when a factory is requested and releases all instances to make * sure that a LogFactoryMock is returned. * * @return An instance of LogFactoryMock. */ public static LogFactoryMock createInstance() { LogFactoryMock.resetInstance(); System.setProperty("org.apache.commons.logging.LogFactory", "se.vgregion.kivtools.mocks.LogFactoryMock"); LogFactory.releaseAll(); return (LogFactoryMock) LogFactory.getFactory(); }
/** * Does things that help the garbage collector clean up the memory. * Only call this after the plugin container has been shutdown. */ private void cleanMemory() { Introspector.flushCaches(); LogFactory.releaseAll(); // for why we need to do this, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6727821 try { Configuration.setConfiguration(null); } catch (Throwable t) { } System.gc(); }
/** * Destroys the XWork component manager because the server is shutting down. * * @param event the servlet context event. */ public void contextDestroyed(ServletContextEvent event) { ServletContext application = event.getServletContext(); ComponentManager container = (ComponentManager) application.getAttribute(ComponentManager.COMPONENT_MANAGER_KEY); if (container != null) { container.dispose(); } // do some cleanup // If the JavaBeans Introspector has been used to analyze application classes, // the Introspector cache will hold a hard reference to those classes. // Consequently, those classes and the web app class loader will not be // garbage collected on web app shutdown! Introspector.flushCaches(); // WW-758 LogFactory.releaseAll(); }
LogFactory.releaseAll();
LogFactory.releaseAll();
/** * Configures logging systems used by <tt>RemoteServer</tt> and its * dependencies. Specifically, * <ul> * <li>Configure Log4J to log to the console</li> * <li>Set Log4J's log level to INFO</li> * <li>Redirect the Jetty's logging to Log4J</li> * <li>Set Jakarta Commons Logging to log to Log4J</li> * </ul> * This is convenient if you do not want to configure the logging yourself. * This will only affect future instances of * {@link org.eclipse.jetty.util.log.Logger} and * {@link org.apache.commons.logging.Log}, so this should be called as early * as possible. */ public static void configureLogging() { Logger root = Logger.getRootLogger(); root.removeAllAppenders(); BasicConfigurator.configure(); root.setLevel(Level.INFO); org.eclipse.jetty.util.log.Log.setLog(new Jetty2Log4J()); LogFactory.releaseAll(); LogFactory.getFactory().setAttribute("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.Log4JLogger"); log = LogFactory.getLog(RemoteServer.class); }
LogFactory.releaseAll(); LogManager.shutdown();
pluginCenter.shutdown(); LogFactory.releaseAll();
public void destroy() { ReferenceCache.finishThreads(); ProviderUtil.getEngine().destroy(); SerializeThreadManager.destroy(); JspProcessor.clear(); LogFactory.releaseAll(); }
public void destroy() { ReferenceCache.finishThreads(); AutoPageBuilder.INSTANCE.destroy(); ProviderUtil.getEngine().destroy(); SerializeThreadManager.destroy(); JspProcessor.clear(); ObjectUtil.clearCaches(); LogFactory.releaseAll(); }