Skip to content

Commit 60cde04

Browse files
author
Bruno Paiva Lima da Silva
committed
fix: using masked properties for logging
1 parent e64bdb9 commit 60cde04

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

wrapper/src/main/java/software/amazon/jdbc/DriverConnectionProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ public Connection connect(
117117
final Properties copy = PropertyUtils.copyProperties(props);
118118
dialect.prepareConnectProperties(copy, protocol, hostSpec);
119119
final ConnectInfo connectInfo = this.targetDriverDialect.prepareConnectInfo(protocol, hostSpec, copy);
120-
120+
121121
LOGGER.finest(() -> "Connecting to " + connectInfo.url
122-
+ PropertyUtils.logProperties(connectInfo.props, "\nwith properties: \n"));
122+
+ PropertyUtils.logProperties(PropertyUtils.maskProperties(connectInfo.props), "\nwith properties: \n"));
123123

124124
Connection conn = this.driver.connect(connectInfo.url, connectInfo.props);
125125

wrapper/src/main/java/software/amazon/jdbc/targetdriverdialect/GenericTargetDriverDialect.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public void prepareDataSource(
7878
props.setProperty("url", finalUrl);
7979

8080
PropertyDefinition.removeAllExceptCredentials(props);
81-
82-
LOGGER.finest(() -> PropertyUtils.logProperties(props, "Connecting with properties: \n"));
81+
LOGGER.finest(() -> PropertyUtils.logProperties(PropertyUtils.maskProperties(props),
82+
"Connecting with properties: \n"));
8383

8484
if (!props.isEmpty()) {
8585
PropertyUtils.applyProperties(dataSource, props);

0 commit comments

Comments
 (0)