Class LoggingConfigurationBuilder

    • Field Detail

      • DEFAULT_LOG_DATA_SOURCE_OUTAGE_AS_ERROR_AFTER

        public static final java.time.Duration DEFAULT_LOG_DATA_SOURCE_OUTAGE_AS_ERROR_AFTER
        The default value for logDataSourceOutageAsErrorAfter(Duration): one minute.
      • logDataSourceOutageAsErrorAfter

        protected java.time.Duration logDataSourceOutageAsErrorAfter
    • Constructor Detail

      • LoggingConfigurationBuilder

        public LoggingConfigurationBuilder()
    • Method Detail

      • logDataSourceOutageAsErrorAfter

        public LoggingConfigurationBuilder logDataSourceOutageAsErrorAfter​(java.time.Duration logDataSourceOutageAsErrorAfter)
        Sets the time threshold, if any, after which the SDK will log a data source outage at ERROR level instead of WARN level.

        A data source outage means that an error condition, such as a network interruption or an error from the LaunchDarkly service, is preventing the SDK from receiving feature flag updates. Many outages are brief and the SDK can recover from them quickly; in that case it may be undesirable to log an ERROR line, which might trigger an unwanted automated alert depending on your monitoring tools. So, by default, the SDK logs such errors at WARN level. However, if the amount of time specified by this method elapses before the data source starts working again, the SDK will log an additional message at ERROR level to indicate that this is a sustained problem.

        The default is DEFAULT_LOG_DATA_SOURCE_OUTAGE_AS_ERROR_AFTER. Setting it to null will disable this feature, so you will only get WARN messages.

        Parameters:
        logDataSourceOutageAsErrorAfter - the error logging threshold, or null
        Returns:
        the builder