Class LoggerConfig

java.lang.Object
com.couchbase.client.core.env.LoggerConfig

public class LoggerConfig extends Object
The LoggerConfig allows to customize various aspects of the SDKs logging behavior.
  • Method Details

    • builder

      public static LoggerConfig.Builder builder()
      Returns a LoggerConfig.Builder which can be used to customize the different logging properties.
    • create

      public static LoggerConfig create()
      Creates a LoggerConfig with all the defaults (can be found in LoggerConfig.Defaults).
      Returns:
      the created, immutable logger config with defaults.
    • fallbackToConsole

      @Deprecated public static LoggerConfig.Builder fallbackToConsole(boolean fallbackToConsole)
      Deprecated.
      Please use builder() 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 public static LoggerConfig.Builder disableSlf4J(boolean disableSlf4J)
      Deprecated.
      Please use builder() 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 public 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.
      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 with builder(), and then call the non-static LoggerConfig.Builder.enableDiagnosticContext(boolean) method.
      Creates a new LoggerConfig builder with the enableDiagnosticContext feature set to the specified value.
      Parameters:
      diagnosticContextEnabled - if the diagnostic context should be enabled.
      Returns:
      a LoggerConfig.Builder for chaining purposes.
    • consoleLogLevel

      @Deprecated public static LoggerConfig.Builder consoleLogLevel(Level consoleLogLevel)
      Deprecated.
      Please use builder() 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 public LoggerConfig.Builder consoleLoggerFormatter(LoggerFormatter loggerFormatter)
      Deprecated.
      Please use builder() 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 public boolean fallbackToConsole()
      Deprecated.
      SLF4J is used for all logging.
      Always returns false.
    • disableSlf4J

      @Deprecated public boolean disableSlf4J()
      Deprecated.
      SLF4J is used for all logging.
      Always returns false.
    • loggerName

      @Deprecated public String 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 public Level consoleLogLevel()
      Deprecated.
      SLF4J is used for all logging. Setting a console log level has no effect.
      Always returns Level.INFO.
    • consoleLoggerFormatter

      @Deprecated public LoggerFormatter 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.