晚上druid配置
This commit is contained in:
+4
@@ -40,6 +40,9 @@ import javax.sql.DataSource;
|
||||
*/
|
||||
@Configuration
|
||||
public class BrowserSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
//todo 待优化,不唯一,应从启动参数中获取
|
||||
public static final String DRUID = "/druid/*";
|
||||
/**
|
||||
* 注入身份认证框架配置参数对象
|
||||
*/
|
||||
@@ -117,6 +120,7 @@ public class BrowserSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
, SecurityConstants.FORM_LOGIN_PROCESSOR_URI
|
||||
, SecurityConstants.GET_VALIDATE_CODE_URI
|
||||
, SecurityConstants.LOGIN_PAGE
|
||||
, DRUID
|
||||
, securityProperties.getBrowser().getHtml())
|
||||
.permitAll()
|
||||
//任何请求
|
||||
|
||||
+5
-4
@@ -51,7 +51,7 @@ public class DataSourceMasterConfig {
|
||||
private DruidMasterParamConfig druidMasterParamConfig;
|
||||
|
||||
/**
|
||||
* 注册druid的servlet
|
||||
* 注册druid的监控视图servlet
|
||||
* @return servletRegistrationBean
|
||||
*/
|
||||
@Bean(name = "masterDruidServlet")
|
||||
@@ -109,7 +109,7 @@ public class DataSourceMasterConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册druid过滤器
|
||||
* 注册druid过滤器用于对url的执行sql进行监控
|
||||
* @return filterRegistrationBean
|
||||
*/
|
||||
@Bean
|
||||
@@ -128,7 +128,7 @@ public class DataSourceMasterConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据BeanId来设置拦截配置,用来bean的监控
|
||||
* spring-druid监控配置
|
||||
* @return druidStatInterceptor
|
||||
*/
|
||||
@Bean(value = "druid-stat-interceptor")
|
||||
@@ -138,7 +138,7 @@ public class DataSourceMasterConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置要拦截统计的bean
|
||||
* 设置要拦截统计的bean,根据BeanId来设置拦截配置,用来bean的监控
|
||||
* @return beanNameAutoProxyCreator
|
||||
*/
|
||||
@Bean
|
||||
@@ -250,6 +250,7 @@ public class DataSourceMasterConfig {
|
||||
}
|
||||
|
||||
try {
|
||||
//开启sql监控
|
||||
druidDataSource.setFilters("stat,wall");
|
||||
} catch (SQLException e) {
|
||||
if (logger.isErrorEnabled()) {
|
||||
|
||||
+1
@@ -136,6 +136,7 @@ public class DataSourceSlaveConfig {
|
||||
}
|
||||
|
||||
try {
|
||||
//开启sql监控
|
||||
druidDataSource.setFilters("stat,wall");
|
||||
} catch (SQLException e) {
|
||||
if (logger.isErrorEnabled()) {
|
||||
|
||||
Reference in New Issue
Block a user