// create new appender based on configuration
if(output instanceof ConsoleOutput) {
appender = new ConsoleAppender<>();
PatternLayoutEncoder pl = new PatternLayoutEncoder();
pl.setContext(loggerContext);
pl.setPattern(output.getPattern());
pl.start();
((ConsoleAppender)appender).setEncoder(pl);
} else if(output instanceof LogFileOutput) {
String basePath = configurationService.getHome() + File.separator + "log" + File.separator;
appender = new RollingFileAppender<>();
((RollingFileAppender)appender).setFile(basePath + ((LogFileOutput) output).getFileName());
TimeBasedRollingPolicy policy = new TimeBasedRollingPolicy();
policy.setContext(loggerContext);
policy.setMaxHistory(((LogFileOutput) output).getKeepDays());
policy.setFileNamePattern(basePath + ((LogFileOutput) output).getFileName() + ".%d{yyyy-MM-dd}.gz");
policy.setParent((FileAppender) appender);
policy.start();
((RollingFileAppender) appender).setRollingPolicy(policy);
PatternLayoutEncoder pl = new PatternLayoutEncoder();
pl.setContext(loggerContext);
pl.setPattern(output.getPattern());
pl.start();
((RollingFileAppender) appender).setEncoder(pl);
} else if(output instanceof SyslogOutput) {
appender = new SyslogAppender();