public static SyslogAppender buildSyslogAppender(LoggingConfiguration.SyslogConfiguration syslog, LoggerContext context, String name, String logFormat) { final SyslogAppender appender = new SyslogAppender(); appender.setName(name); appender.setContext(context); appender.setSyslogHost(syslog.getHost()); appender.setFacility(syslog.getFacility().toString()); addThresholdFilter(appender, syslog.getThreshold()); if (logFormat != null) { appender.setSuffixPattern(logFormat); } appender.start(); return appender; }
private static boolean syslogAppenderFound(Iterator<Appender<ILoggingEvent>> iterator) { while (iterator.hasNext()) { Appender<ILoggingEvent> appender = iterator.next(); if (appender instanceof SyslogAppender) { return true; } } return false; }