appender.activateOptions();
for (int i = 0; i < 1000; i++) {
StopWatch stopWatch = new StopWatch("testOverflow");
Math.random(); //this should happen super fast, faster than the appender's Dispatcher thread can drain
logger.info(stopWatch.stop());
}
//again close the appender
appender.close();
assertTrue("Expected some stop watch messages to get discarded", appender.getNumDiscardedMessages() > 0);