mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +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.guacamole.GuacamoleException;
|
||||||
import org.apache.ibatis.datasource.pooled.PooledDataSource;
|
import org.apache.ibatis.datasource.pooled.PooledDataSource;
|
||||||
import org.apache.ibatis.datasource.unpooled.UnpooledDataSource;
|
import org.apache.ibatis.datasource.unpooled.UnpooledDataSource;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pooled DataSource implementation which dynamically retrieves the database
|
* Pooled DataSource implementation which dynamically retrieves the database
|
||||||
@@ -37,6 +39,11 @@ import org.apache.ibatis.datasource.unpooled.UnpooledDataSource;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public class DynamicallyAuthenticatedDataSource extends PooledDataSource {
|
public class DynamicallyAuthenticatedDataSource extends PooledDataSource {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logger for this class.
|
||||||
|
*/
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(DynamicallyAuthenticatedDataSource.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new DynamicallyAuthenticatedDataSource which dynamically
|
* Creates a new DynamicallyAuthenticatedDataSource which dynamically
|
||||||
* retrieves database credentials from the given JDBCEnvironment each time
|
* retrieves database credentials from the given JDBCEnvironment each time
|
||||||
@@ -63,6 +70,7 @@ public class DynamicallyAuthenticatedDataSource extends PooledDataSource {
|
|||||||
@Override
|
@Override
|
||||||
public Connection getConnection() throws SQLException {
|
public Connection getConnection() throws SQLException {
|
||||||
try {
|
try {
|
||||||
|
logger.debug("Creating new database connection for pool.");
|
||||||
return super.getConnection(environment.getUsername(), environment.getPassword());
|
return super.getConnection(environment.getUsername(), environment.getPassword());
|
||||||
}
|
}
|
||||||
catch (GuacamoleException e) {
|
catch (GuacamoleException e) {
|
||||||
|
Reference in New Issue
Block a user