Package com.mongodb

Class LoggerSettings

java.lang.Object
com.mongodb.LoggerSettings

@Immutable public final class LoggerSettings extends Object
An immutable class representing settings for logging.

The driver logs using the SLF4J 1.0 API with a root logger of org.mongodb.driver. See Logging Fundamentals for additional information.

Since:
4.9
  • Method Details

    • builder

      public static LoggerSettings.Builder builder()
      Gets a builder for an instance of LoggerSettings.
      Returns:
      the builder
    • builder

      public static LoggerSettings.Builder builder(LoggerSettings loggerSettings)
      Creates a builder instance.
      Parameters:
      loggerSettings - existing LoggerSettings to default the builder settings on.
      Returns:
      a builder
    • getMaxDocumentLength

      public int getMaxDocumentLength()
      Gets the max length of the extended JSON representation of a BSON document within a log message.

      For example, when the driver logs a command or its reply via the org.mongodb.driver.protocol.command SFL4J logger, it truncates its JSON representation to the maximum length defined by this setting.

      Defaults to 1000 characters.

      Returns:
      the max document length
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object