Package com.mongodb
Class LoggerSettings
java.lang.Object
com.mongodb.LoggerSettings
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder for an instance ofLoggerSettings. -
Method Summary
Modifier and TypeMethodDescriptionstatic LoggerSettings.Builderbuilder()Gets a builder for an instance ofLoggerSettings.static LoggerSettings.Builderbuilder(LoggerSettings loggerSettings) Creates a builder instance.booleanintGets the max length of the extended JSON representation of a BSON document within a log message.inthashCode()toString()
-
Method Details
-
builder
Gets a builder for an instance ofLoggerSettings.- Returns:
- the builder
-
builder
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.commandSFL4J logger, it truncates its JSON representation to the maximum length defined by this setting.Defaults to 1000 characters.
- Returns:
- the max document length
-
equals
-
hashCode
public int hashCode() -
toString
-