public void applyPostCreate(final ObjectProducer param) { configuration.getLoggerRefs().get(getName()).setFilter((Filter) param.getObject()); }
@SuppressWarnings({"unchecked"}) public void rollback() { if (refLogger != null) { refLogger.setFilter(filter); if (handlers != null) refLogger.setHandlers(handlers); refLogger.setLevel(level); refLogger.setUseParentHandlers(useParentHandlers); configs.put(name, LoggerConfigurationImpl.this); } clearRemoved(); } };
public void applyPostCreate(final Void param) { if (refLogger != null) { refLogger.setFilter(null); refLogger.clearHandlers(); refLogger.setLevel(null); refLogger.setUseParentHandlers(true); } }
private static void clearLogContext() { // Remove the configurator and clear the log context final Configurator configurator = EMBEDDED_LOG_CONTEXT.getLogger("").detach(Configurator.ATTACHMENT_KEY); // If this was a PropertyConfigurator we can use the LogContextConfiguration API to tear down the LogContext if (configurator instanceof PropertyConfigurator) { final LogContextConfiguration logContextConfiguration = ((PropertyConfigurator) configurator).getLogContextConfiguration(); clearLogContext(logContextConfiguration); } else if (configurator instanceof LogContextConfiguration) { clearLogContext((LogContextConfiguration) configurator); } else { // Remove all the handlers and close them as well as reset the loggers final List<String> loggerNames = Collections.list(EMBEDDED_LOG_CONTEXT.getLoggerNames()); for (String name : loggerNames) { final Logger logger = EMBEDDED_LOG_CONTEXT.getLoggerIfExists(name); if (logger != null) { final Handler[] handlers = logger.clearHandlers(); if (handlers != null) { for (Handler handler : handlers) { handler.close(); } } logger.setFilter(null); logger.setUseParentFilters(false); logger.setUseParentHandlers(true); logger.setLevel(Level.INFO); } } } }
private static void clearLogContext() { // Remove the configurator and clear the log context final Configurator configurator = EMBEDDED_LOG_CONTEXT.getLogger("").detach(Configurator.ATTACHMENT_KEY); // If this was a PropertyConfigurator we can use the LogContextConfiguration API to tear down the LogContext if (configurator instanceof PropertyConfigurator) { final LogContextConfiguration logContextConfiguration = ((PropertyConfigurator) configurator).getLogContextConfiguration(); clearLogContext(logContextConfiguration); } else if (configurator instanceof LogContextConfiguration) { clearLogContext((LogContextConfiguration) configurator); } else { // Remove all the handlers and close them as well as reset the loggers final List<String> loggerNames = Collections.list(EMBEDDED_LOG_CONTEXT.getLoggerNames()); for (String name : loggerNames) { final Logger logger = EMBEDDED_LOG_CONTEXT.getLoggerIfExists(name); if (logger != null) { final Handler[] handlers = logger.clearHandlers(); if (handlers != null) { for (Handler handler : handlers) { handler.close(); } } logger.setFilter(null); logger.setUseParentFilters(false); logger.setUseParentHandlers(true); logger.setLevel(Level.INFO); } } } }
logger.setFilter(null); logger.setUseParentFilters(false); logger.setUseParentHandlers(true);
logger.setFilter(null); logger.setUseParentFilters(false); logger.setUseParentHandlers(true);