Package com.couchbase.client.core.env
Class LoggerConfig
java.lang.Object
com.couchbase.client.core.env.LoggerConfig
The
LoggerConfig allows to customize various aspects of the SDKs logging behavior.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionstatic LoggerConfig.Builderbuilder()Returns aLoggerConfig.Builderwhich can be used to customize the different logging properties.Deprecated.SLF4J is used for all logging.consoleLoggerFormatter(LoggerFormatter loggerFormatter) Deprecated.Please usebuilder()instead.Deprecated.SLF4J is used for all logging.static LoggerConfig.BuilderconsoleLogLevel(Level consoleLogLevel) Deprecated.Please usebuilder()instead.static LoggerConfigcreate()Creates aLoggerConfigwith all the defaults (can be found inLoggerConfig.Defaults).booleanReturns true if the diagnostic context is enabled (disabled by default).booleanDeprecated.SLF4J is used for all logging.static LoggerConfig.BuilderdisableSlf4J(boolean disableSlf4J) Deprecated.Please usebuilder()instead.static LoggerConfig.BuilderenableDiagnosticContext(boolean diagnosticContextEnabled) Deprecated.Instead, please create a new builder withbuilder(), and then call the non-staticLoggerConfig.Builder.enableDiagnosticContext(boolean)method.booleanDeprecated.SLF4J is used for all logging.static LoggerConfig.BuilderfallbackToConsole(boolean fallbackToConsole) Deprecated.Please usebuilder()instead, and configure your SLF4J binding to log to the console if desired.Deprecated.Setting a custom logger name has no effect.static LoggerConfig.BuilderloggerName(String loggerName) Deprecated.the logging infrastructure picks the logger name automatically now based on the event type so it is easier to enable/disable logging or change the verbosity level for certain groups rather than having a single universal logger name.
-
Method Details
-
builder
Returns aLoggerConfig.Builderwhich can be used to customize the different logging properties. -
create
Creates aLoggerConfigwith all the defaults (can be found inLoggerConfig.Defaults).- Returns:
- the created, immutable logger config with defaults.
-
fallbackToConsole
Deprecated.Please usebuilder()instead, and configure your SLF4J binding to log to the console if desired.Returns a new LoggerConfig builder with default settings.SLF4J is used for all logging. If you wish to log to the console, please configure your SLF4J binding accordingly.
- Parameters:
fallbackToConsole- ignored- Returns:
- a
LoggerConfig.Builderfor chaining purposes.
-
disableSlf4J
Deprecated.Please usebuilder()instead.Returns a new LoggerConfig builder with default settings.Deprecated because SLF4J is used for all logging, and cannot be disabled.
- Parameters:
disableSlf4J- ignored- Returns:
- a
LoggerConfig.Builderfor chaining purposes.
-
loggerName
Deprecated.the logging infrastructure picks the logger name automatically now based on the event type so it is easier to enable/disable logging or change the verbosity level for certain groups rather than having a single universal logger name.Returns a new LoggerConfig builder with default settings.- Parameters:
loggerName- ignored- Returns:
- a
LoggerConfig.Builderfor chaining purposes.
-
enableDiagnosticContext
@Deprecated public static LoggerConfig.Builder enableDiagnosticContext(boolean diagnosticContextEnabled) Deprecated.Instead, please create a new builder withbuilder(), and then call the non-staticLoggerConfig.Builder.enableDiagnosticContext(boolean)method.Creates a new LoggerConfig builder with theenableDiagnosticContextfeature set to the specified value.- Parameters:
diagnosticContextEnabled- if the diagnostic context should be enabled.- Returns:
- a
LoggerConfig.Builderfor chaining purposes.
-
consoleLogLevel
Deprecated.Please usebuilder()instead.Returns a new LoggerConfig builder with default settings.Deprecated because SLF4J is used for all logging. Please configure logging settings like this via your SLF4J binding.
- Parameters:
consoleLogLevel- ignored- Returns:
- a
LoggerConfig.Builderfor chaining purposes.
-
consoleLoggerFormatter
Deprecated.Please usebuilder()instead.Returns a new LoggerConfig builder with default settings.Deprecated because SLF4J is used for all logging. Please configure this kind of logging setting via your SLF4J binding.
- Parameters:
loggerFormatter- ignored- Returns:
- a
LoggerConfig.Builderfor chaining purposes.
-
fallbackToConsole
Deprecated.SLF4J is used for all logging.Always returns false. -
disableSlf4J
Deprecated.SLF4J is used for all logging.Always returns false. -
loggerName
Deprecated.Setting a custom logger name has no effect.Always returns empty string. -
diagnosticContextEnabled
public boolean diagnosticContextEnabled()Returns true if the diagnostic context is enabled (disabled by default). -
consoleLogLevel
Deprecated.SLF4J is used for all logging. Setting a console log level has no effect.Always returnsLevel.INFO. -
consoleLoggerFormatter
Deprecated.SLF4J is used for all logging. Setting a custom console logger formatter has no effect.Always returns an instance of DefaultLoggerFormatter.- Returns:
- the logger formatter.
-