PatternLayoutEncoder patternLayoutEncoder = new PatternLayoutEncoder();
patternLayoutEncoder.setPattern("%-4relative [%thread] %-5level %logger{35} - %msg %n");
patternLayoutEncoder.setContext(loggerContext);
patternLayoutEncoder.start();
ConsoleAppender consoleAppender = new ConsoleAppender();
consoleAppender.setContext(loggerContext);
consoleAppender.setName("CON");
consoleAppender.setEncoder(patternLayoutEncoder);
consoleAppender.start();
Logger root = loggerContext.getLogger(Logger.ROOT_LOGGER_NAME);
root.setLevel(Level.DEBUG);
root.addAppender(consoleAppender);