/** * Shutdown using the LoggerContext appropriate for the caller of this method. * This is equivalent to calling {@code LogManager.shutdown(false)}. * * This call is synchronous and will block until shut down is complete. * This may include flushing pending log events over network connections. * * @since 2.6 */ public static void shutdown() { shutdown(false); }
/** * Cleans up the logger configuration. Should be used in unit tests only for sequential tests run with * different configurations */ static void cleanup() { synchronized (mux) { if (inited) LogManager.shutdown(); inited = false; } }
/** * Shutdown the logging system if the logging system supports it. * This is equivalent to calling {@code LogManager.shutdown(LogManager.getContext(currentContext))}. * * This call is synchronous and will block until shut down is complete. * This may include flushing pending log events over network connections. * * @param currentContext if true a default LoggerContext (may not be the LoggerContext used to create a Logger * for the calling class) will be used. * If false the LoggerContext appropriate for the caller of this method is used. For * example, in a web application if the caller is a class in WEB-INF/lib then one LoggerContext may be * used and if the caller is a class in the container's classpath then a different LoggerContext may * be used. * @since 2.6 */ public static void shutdown(final boolean currentContext) { shutdown(getContext(currentContext)); }
@AfterClass public static void tearDown() { System.clearProperty("log4j.configurationFile"); LogManager.shutdown(); }
public void run() { try { DAO.log("catched main termination signal"); LoklakInstallation.server.stop(); DAO.close(); DAO.log("main terminated, goodby."); DAO.log("Shutting down log4j2"); LogManager.shutdown(); } catch (Exception e) { } } });
public void run() { try { DAO.log("catched main termination signal"); LoklakServer.dumpImporter.shutdown(); LoklakServer.queuedIndexing.shutdown(); LoklakServer.caretaker.shutdown(); LoklakServer.server.stop(); DAO.close(); TwitterScraper.executor.shutdown(); LoklakServer.harvester.stop(); DAO.log("main terminated, goodby."); //LoklakServer.saveConfig(); DAO.log("saved customized_config.properties"); DAO.log("Shutting down log4j2"); LogManager.shutdown(); } catch (Exception e) { } } });
LogManager.shutdown();
@Override public void close() { LogManager.shutdown(); } }
/** * Shutdown using the LoggerContext appropriate for the caller of this method. * This is equivalent to calling {@code LogManager.shutdown(false)}. * * This call is synchronous and will block until shut down is complete. * This may include flushing pending log events over network connections. * * @since 2.6 */ public static void shutdown() { shutdown(false); }
/** * Cleans up the logger configuration. Should be used in unit tests only for sequential tests run with * different configurations */ static void cleanup() { synchronized (mux) { if (inited) LogManager.shutdown(); inited = false; } }
@Override public void stop(final BundleContext context) throws Exception { provideRegistration.unregister(); this.contextRef.compareAndSet(context, null); LogManager.shutdown(); }
public void shutdown() { try { // We disabled the log4j shutdown hook to gain more control and keep logs during shutdown. // See #disableLog4jShutdownHook() // Otoh that means we need to shutdown Log4j manually. // So here we go... LogManager.shutdown(); } catch (final Exception e) { System.out.println("A problem happened when shutting down Log4j: " + e + "\n" + e.getMessage()); } } }
public void shutdown() { try { // We disabled the log4j shutdown hook to gain more control and keep logs during shutdown. // See #disableLog4jShutdownHook() // Otoh that means we need to shutdown Log4j manually. // So here we go... LogManager.shutdown(); } catch (final Exception e) { System.out.println("A problem happened when shutting down Log4j: " + e + "\n" + e.getMessage()); } } }
/** * Shuts down Log4J. */ public static void shutdownLogging() { log("Shutting down Log4J"); LogManager.shutdown(); }
public static void shutdown() { try { DaemonBase.closeAll(); LogManager.shutdown(); } catch(final Throwable cause) { cause.printStackTrace(System.err); } } //
@Override public void shutdownLogging() { LogManager.shutdown(); }
static void shutdown() throws InterruptRunException { try { DaemonBase.closeAll(); } catch (final InterruptRunException e) { throw e; } catch (final Throwable cause) { cause.printStackTrace(System.err); } finally { LogManager.shutdown(); } }
/** * Call registered shutdown hooks in the order of registration. */ private static synchronized void shutdownHook() { // shutdown hooks for (Pair<String, Runnable> r : shutdownHooks) { try { logger.info("Shutting down {}", r.getLeft()); r.getRight().run(); } catch (Exception e) { logger.info("Failed to shutdown {}", r.getLeft(), e); } } // flush log4j async loggers LogManager.shutdown(); } }
public static synchronized void halt(int status) { LOGGER.fatal("JVM halting with status {}; thread dump at halt: {}", status, ThreadDumpUtil.takeDumpString()); // try to give time for the log to be emitted... LogManager.shutdown(); Runtime.getRuntime().halt(status); }