Improved logging in ConnectionFactory