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
Modifier and TypeClassDescriptionstatic class
static class
-
Method Summary
Modifier and TypeMethodDescriptionstatic LoggerConfig.Builder
builder()
Deprecated.Deprecated.SLF4J is used for all logging.consoleLoggerFormatter
(LoggerFormatter loggerFormatter) Deprecated.Please usebuilder()
instead.Deprecated.SLF4J is used for all logging.static LoggerConfig.Builder
consoleLogLevel
(Level consoleLogLevel) Deprecated.Please usebuilder()
instead.static LoggerConfig
create()
Deprecated.Instead, please useCoreEnvironment.Builder.loggerConfig(Consumer)
and configure the builder passed to the consumer.boolean
Returns true if the diagnostic context is enabled (disabled by default).boolean
Deprecated.SLF4J is used for all logging.static LoggerConfig.Builder
disableSlf4J
(boolean disableSlf4J) Deprecated.Please usebuilder()
instead.static LoggerConfig.Builder
enableDiagnosticContext
(boolean diagnosticContextEnabled) Deprecated.Instead, please create a new builder withbuilder()
, and then call the non-staticLoggerConfig.Builder.enableDiagnosticContext(boolean)
method.boolean
Deprecated.SLF4J is used for all logging.static LoggerConfig.Builder
fallbackToConsole
(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.Builder
loggerName
(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
Deprecated.Instead of creating a new builder, please useCoreEnvironment.Builder.loggerConfig(Consumer)
and configure the builder passed to the consumer. Note: CoreEnvironment is a base class; you'll probably call that method via a subclass namedClusterEnvironment
.Returns aLoggerConfig.Builder
which can be used to customize the different logging properties. -
create
Deprecated.Instead, please useCoreEnvironment.Builder.loggerConfig(Consumer)
and configure the builder passed to the consumer. Note: CoreEnvironment is a base class; you'll probably call that method via a subclass namedClusterEnvironment
.Creates aLoggerConfig
with 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.Builder
for 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.Builder
for 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.Builder
for 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 theenableDiagnosticContext
feature set to the specified value.- Parameters:
diagnosticContextEnabled
- if the diagnostic context should be enabled.- Returns:
- a
LoggerConfig.Builder
for 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.Builder
for 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.Builder
for 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.
-
CoreEnvironment.Builder.loggerConfig(Consumer)
and configure the builder passed to the consumer.