From 50f3a2c6140514572b06a351f8492c419b00755c Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Fri, 17 May 2013 12:11:38 +0100 Subject: [PATCH] Add logging to BasicDataSourceConfiguration --- pom.xml | 11 +++++++++++ .../jdbc/BasicDataSourceConfiguration.java | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/pom.xml b/pom.xml index 0cef747b08..cbefe79171 100644 --- a/pom.xml +++ b/pom.xml @@ -24,6 +24,7 @@ 2.2.3.RELEASE 2.2.0.RC2 7.0.39 + 1.7.2 @@ -562,6 +563,16 @@ + + org.aspectj + aspectjrt + ${aspectj.version} + + + org.aspectj + aspectjweaver + ${aspectj.version} + org.yaml snakeyaml diff --git a/spring-bootstrap/src/main/java/org/springframework/bootstrap/autoconfigure/jdbc/BasicDataSourceConfiguration.java b/spring-bootstrap/src/main/java/org/springframework/bootstrap/autoconfigure/jdbc/BasicDataSourceConfiguration.java index 59e3b5a064..c2619b00ff 100644 --- a/spring-bootstrap/src/main/java/org/springframework/bootstrap/autoconfigure/jdbc/BasicDataSourceConfiguration.java +++ b/spring-bootstrap/src/main/java/org/springframework/bootstrap/autoconfigure/jdbc/BasicDataSourceConfiguration.java @@ -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());