@Test public void testThreadContext() { final Logger logger = LogManager.getLogger("test"); ThreadContext.push("Message only"); ThreadContext.push("int", 1); ThreadContext.push("int-long-string", 1, 2l, "3"); ThreadContext.put("key", "value"); logger.info("Hello World"); ThreadContext.clearAll(); }
@Before public void recordTestName() { waitAQuarterSecond(); logger.info("Recording TestName, @Before method"); waitAQuarterSecond(); ThreadContext.push(testName.getMethodName()); logger.info("TestName: " + testName); waitAQuarterSecond(); logger.info("Done Recording TestName\n\n"); }