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
Modifier and TypeClassDescriptionstatic final class
A builder for an instance ofLoggerSettings
. -
Method Summary
Modifier and TypeMethodDescriptionstatic LoggerSettings.Builder
builder()
Gets a builder for an instance ofLoggerSettings
.static LoggerSettings.Builder
builder
(LoggerSettings loggerSettings) Creates a builder instance.boolean
int
Gets the max length of the extended JSON representation of a BSON document within a log message.int
hashCode()
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.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
-
hashCode
public int hashCode() -
toString
-