Skip to content

Commit 07c21d5

Browse files
committed
Protected trace logging statement in DefaultConnectionPool with check for whether trace logging is enabled.
1 parent eb1d502 commit 07c21d5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

driver-core/src/main/com/mongodb/connection/DefaultConnectionPool.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ private PooledConnection getPooledConnection(final long timeout, final TimeUnit
246246
internalConnection = pool.get(timeout, timeUnit);
247247
}
248248
connectionPoolListener.connectionCheckedOut(new ConnectionEvent(internalConnection.getDescription().getConnectionId()));
249-
LOGGER.trace(format("Checked out connection [%s] to server %s", getId(internalConnection), serverId.getAddress()));
249+
if (LOGGER.isTraceEnabled()) {
250+
LOGGER.trace(format("Checked out connection [%s] to server %s", getId(internalConnection), serverId.getAddress()));
251+
}
250252
return new PooledConnection(internalConnection);
251253
}
252254

0 commit comments

Comments
 (0)