public void start()

in src/main/java/com/spotify/logging/logback/SpotifyInternalAppender.java [51:74]


  public void start() {
    if (serviceName == null) {
      throw new IllegalStateException("serviceName must be configured");
    }

    // set up some defaults
    setFacility("LOCAL0");

    // our internal syslog-ng configuration splits logs up based on service name, and expects the
    // format below.
    String serviceAndPid = String.format("%s[%s]", serviceName, getMyPid());
    setSuffixPattern(
        serviceAndPid
            + ": "
            + LoggingConfigurator.ReplaceNewLines.getMsgPattern(this.replaceNewLines));
    setStackTracePattern(serviceAndPid + ": " + CoreConstants.TAB);

    if (getSyslogHost() == null) {
      setSyslogHost(System.getenv(LoggingConfigurator.SPOTIFY_SYSLOG_HOST));
    }
    checkSetPort(System.getenv(LoggingConfigurator.SPOTIFY_SYSLOG_PORT));

    super.start();
  }