@Override public Logger apply(Boolean init) { if (init) ctx.reconfigure(); return (Logger)LogManager.getRootLogger(); } });
@Test public void deadlockOnReconfigure() { context.getLoggerContext().reconfigure(); } }
@AfterClass public static void cleanupClass() { System.clearProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY); final LoggerContext ctx = LoggerContext.getContext(); ctx.reconfigure(); StatusLogger.getLogger().reset(); final File file = new File(STATUS_LOG); file.delete(); }
@Test public void testDefaultStatus() { System.setProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG1); System.setProperty(Constants.LOG4J_DEFAULT_STATUS_LEVEL, "WARN"); try { final LoggerContext ctx = LoggerContext.getContext(); ctx.reconfigure(); final Configuration config = ctx.getConfiguration(); assertTrue("Configuration is not an XmlConfiguration", config instanceof XmlConfiguration); } finally { System.clearProperty(Constants.LOG4J_DEFAULT_STATUS_LEVEL); } }
@BeforeClass public static void setupClass() { try { Class.forName("java.io.ObjectInputFilter"); useObjectInputStream = true; } catch (ClassNotFoundException ex) { // Ignore the exception } ConfigurationFactory.setConfigurationFactory(cf); final LoggerContext ctx = LoggerContext.getContext(); ctx.reconfigure(); }
@AfterClass public static void cleanupClass() { System.clearProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY); ctx.reconfigure(); StatusLogger.getLogger().reset(); }
@BeforeClass public static void setupClass() { ConfigurationFactory.setConfigurationFactory(cf); final LoggerContext ctx = LoggerContext.getContext(); ctx.reconfigure(); }
@BeforeClass public static void setupClass() { ConfigurationFactory.setConfigurationFactory(configFactory); final LoggerContext ctx = LoggerContext.getContext(); ctx.reconfigure(); }
@BeforeClass public static void setupClass() { ConfigurationFactory.setConfigurationFactory(cf); final LoggerContext ctx = LoggerContext.getContext(); ctx.reconfigure(); }
@BeforeClass public static void setupClass() { ConfigurationFactory.setConfigurationFactory(cf); final LoggerContext ctx = LoggerContext.getContext(); ctx.reconfigure(); }
@BeforeClass public static void setupClass() { ConfigurationFactory.setConfigurationFactory(cf); final LoggerContext ctx = LoggerContext.getContext(); ctx.reconfigure(); }
@Test public void testNoProps() { System.setProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY, CONFIG); final LoggerContext ctx = LoggerContext.getContext(); ctx.reconfigure(); final Configuration config = ctx.getConfiguration(); assertTrue("Configuration is not an XmlConfiguration", config instanceof XmlConfiguration); }
@BeforeClass public static void setupClass() { ConfigurationFactory.setConfigurationFactory(cf); final LoggerContext ctx = LoggerContext.getContext(); ctx.reconfigure(); }
@AfterClass public static void cleanupClass() { System.clearProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY); final LoggerContext ctx = LoggerContext.getContext(); ctx.reconfigure(); StatusLogger.getLogger().reset(); }
@AfterClass public static void cleanupClass() { System.clearProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY); final LoggerContext ctx = LoggerContext.getContext(); ctx.reconfigure(); StatusLogger.getLogger().reset(); }
@After public void cleanup() { final LoggerContext ctx = LoggerContext.getContext(false); ctx.reconfigure(); StatusLogger.getLogger().reset(); }
@BeforeClass public static void setupClass() { ThreadContext.clearAll(); ConfigurationFactory.setConfigurationFactory(cf); final LoggerContext ctx = LoggerContext.getContext(); ctx.reconfigure(); }
@BeforeClass public static void setupClass() { ThreadContext.clearAll(); ConfigurationFactory.setConfigurationFactory(cf); final LoggerContext ctx = LoggerContext.getContext(); ctx.reconfigure(); }
@BeforeClass public static void setupClass() { StatusLogger.getLogger().setLevel(Level.OFF); ConfigurationFactory.setConfigurationFactory(cf); final LoggerContext ctx = LoggerContext.getContext(); ctx.reconfigure(); }
@BeforeClass public static void setupClass() throws Exception { tcpServer = new TcpSocketTestServer(PORT); tcpServer.start(); udpServer = new UdpSocketTestServer(); udpServer.start(); LoggerContext.getContext().reconfigure(); ThreadContext.clearAll(); }