mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUACAMOLE-641: Log creation of new database connections.
This commit is contained in:
@@ -28,6 +28,8 @@ import java.util.Properties;
|
||||
import org.apache.guacamole.GuacamoleException;
|
||||
import org.apache.ibatis.datasource.pooled.PooledDataSource;
|
||||
import org.apache.ibatis.datasource.unpooled.UnpooledDataSource;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Pooled DataSource implementation which dynamically retrieves the database
|
||||
@@ -37,6 +39,11 @@ import org.apache.ibatis.datasource.unpooled.UnpooledDataSource;
|
||||
@Singleton
|
||||
public class DynamicallyAuthenticatedDataSource extends PooledDataSource {
|
||||
|
||||
/**
|
||||
* Logger for this class.
|
||||
*/
|
||||
private static final Logger logger = LoggerFactory.getLogger(DynamicallyAuthenticatedDataSource.class);
|
||||
|
||||
/**
|
||||
* Creates a new DynamicallyAuthenticatedDataSource which dynamically
|
||||
* retrieves database credentials from the given JDBCEnvironment each time
|
||||
@@ -63,6 +70,7 @@ public class DynamicallyAuthenticatedDataSource extends PooledDataSource {
|
||||
@Override
|
||||
public Connection getConnection() throws SQLException {
|
||||
try {
|
||||
logger.debug("Creating new database connection for pool.");
|
||||
return super.getConnection(environment.getUsername(), environment.getPassword());
|
||||
}
|
||||
catch (GuacamoleException e) {
|
||||
|
Reference in New Issue
Block a user