Add logging to BasicDataSourceConfiguration

pull/1/merge
Dave Syer 12 years ago
parent 2dc296caa9
commit 50f3a2c614

@ -24,6 +24,7 @@
<spring.integration.version>2.2.3.RELEASE</spring.integration.version>
<spring.batch.version>2.2.0.RC2</spring.batch.version>
<tomcat.version>7.0.39</tomcat.version>
<aspectj.version>1.7.2</aspectj.version>
</properties>
<scm>
@ -562,6 +563,16 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>

@ -18,6 +18,8 @@ package org.springframework.bootstrap.autoconfigure.jdbc;
import javax.sql.DataSource;
import org.apache.commons.dbcp.BasicDataSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -31,8 +33,11 @@ import org.springframework.context.annotation.Configuration;
@Configuration
public class BasicDataSourceConfiguration extends AbstractDataSourceConfiguration {
private static Log logger = LogFactory.getLog(BasicDataSourceConfiguration.class);
@Bean
public DataSource dataSource() {
logger.info("Hint: using Commons DBCP BasicDataSource. It's going to work, but the Tomcat DataSource is more reliable.");
BasicDataSource pool = new BasicDataSource();
pool.setDriverClassName(getDriverClassName());
pool.setUrl(getUrl());

Loading…
Cancel
Save