code: static Appender<ILoggingEvent> getSyslogAppender(final LoggerContext context,
                                                     final String host,
                                                     final int port,
                                                     final ReplaceNewLines replaceNewLines) {
      final String h = isNullOrEmpty(host) ? "localhost" : host;
      final int p = port < 0 ? 514 : port;
  
      final MillisecondPrecisionSyslogAppender appender = new MillisecondPrecisionSyslogAppender();
  
      appender.setFacility("LOCAL0");
      appender.setSyslogHost(h);
      appender.setPort(p);
      appender.setName("syslog");
      appender.setCharset(Charsets.UTF_8);
      appender.setContext(context);
      appender.setSuffixPattern(
          "%property{ident}[%property{pid}]: " + ReplaceNewLines.getMsgPattern(replaceNewLines));
      appender.setStackTracePattern(
          "%property{ident}[%property{pid}]: " + CoreConstants.TAB);
      appender.start();
  
      return appender;
    }
docs: Create a syslog appender. The appender will use the facility local0. If host is null or an
  empty string, default to "localhost". If port is less than 0, default to 514.
  
  @param context The logger context to use.
  @param host The host running the syslog daemon.
  @param port The port to connect to.
  @return An appender that writes to syslog.