Skip to content

Commit dc3c177

Browse files
committed
Remove connection string from log message
A connection string containing an unsupported option generates a log message at warning level to the "org.mongodb.driver.uri" component. The log message contains the full connection string. As the connection string may contain the credentials used to authenticate, it should not be logged. This commit removes the full connection string from the log message, and instead just logs the name of the unsupported option. JAVA-3093
1 parent 0c01d71 commit dc3c177

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

driver-core/src/main/com/mongodb/ConnectionString.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ private void warnOnUnsupportedOptions(final Map<String, List<String>> optionsMap
438438
for (final String key : optionsMap.keySet()) {
439439
if (!ALL_KEYS.contains(key)) {
440440
if (LOGGER.isWarnEnabled()) {
441-
LOGGER.warn(format("Unsupported option '%s' in the connection string '%s'.", key, connectionString));
441+
LOGGER.warn(format("Connection string contains unsupported option '%s'.", key));
442442
}
443443
}
444444
}

0 commit comments

Comments
 (0)