Class LoggingConfigurationBuilder
- All Implemented Interfaces:
LoggingConfigurationFactory
public abstract class LoggingConfigurationBuilder extends java.lang.Object implements LoggingConfigurationFactory
If you want to set non-default values for any of these properties, create a builder with
Components.logging(), change its properties with the methods of this class, and pass it
to LDConfig.Builder.logging(LoggingConfigurationFactory):
LDConfig config = new LDConfig.Builder()
.logging(
Components.logging()
.logDataSourceOutageAsErrorAfter(Duration.ofSeconds(120))
)
.build();
Note that this class is abstract; the actual implementation is created by calling Components.logging().
- Since:
- 5.0.0
-
Field Summary
Fields Modifier and Type Field Description static java.time.DurationDEFAULT_LOG_DATA_SOURCE_OUTAGE_AS_ERROR_AFTERThe default value forlogDataSourceOutageAsErrorAfter(Duration): one minute.protected java.time.DurationlogDataSourceOutageAsErrorAfter -
Constructor Summary
Constructors Constructor Description LoggingConfigurationBuilder() -
Method Summary
Modifier and Type Method Description LoggingConfigurationBuilderlogDataSourceOutageAsErrorAfter(java.time.Duration logDataSourceOutageAsErrorAfter)Sets the time threshold, if any, after which the SDK will log a data source outage atERRORlevel instead ofWARNlevel.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.launchdarkly.sdk.server.interfaces.LoggingConfigurationFactory
createLoggingConfiguration
-
Field Details
-
DEFAULT_LOG_DATA_SOURCE_OUTAGE_AS_ERROR_AFTER
public static final java.time.Duration DEFAULT_LOG_DATA_SOURCE_OUTAGE_AS_ERROR_AFTERThe default value forlogDataSourceOutageAsErrorAfter(Duration): one minute. -
logDataSourceOutageAsErrorAfter
protected java.time.Duration logDataSourceOutageAsErrorAfter
-
-
Constructor Details
-
LoggingConfigurationBuilder
public LoggingConfigurationBuilder()
-
-
Method Details
-
logDataSourceOutageAsErrorAfter
public LoggingConfigurationBuilder logDataSourceOutageAsErrorAfter(java.time.Duration logDataSourceOutageAsErrorAfter)Sets the time threshold, if any, after which the SDK will log a data source outage atERRORlevel instead ofWARNlevel.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
ERRORline, which might trigger an unwanted automated alert depending on your monitoring tools. So, by default, the SDK logs such errors atWARNlevel. 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 atERRORlevel to indicate that this is a sustained problem.The default is
DEFAULT_LOG_DATA_SOURCE_OUTAGE_AS_ERROR_AFTER. Setting it tonullwill disable this feature, so you will only getWARNmessages.- Parameters:
logDataSourceOutageAsErrorAfter- the error logging threshold, or null- Returns:
- the builder
-