List<LogEvent> events = app.getEvents();
assertTrue("Incorrect number of events. Expected 1, actual " + events.size(), events.size() == 1);
app.clear();
final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
final Configuration config = ctx.getConfiguration();
final LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME);
/* You could also specify the actual logger name as below and it will return the LoggerConfig used by the Logger.
LoggerConfig loggerConfig = getLoggerConfig("com.apache.test");
*/
loggerConfig.setLevel(Level.DEBUG);
ctx.updateLoggers(); // This causes all Loggers to refetch information from their LoggerConfig.
logger.entry();
events = app.getEvents();
assertTrue("Incorrect number of events. Expected 0, actual " + events.size(), events.size() == 0);
app.clear();