diff --git a/druid-spring-boot-starter/README.md b/druid-spring-boot-starter/README.md index 9ec3237d9d..e7d0a32b2a 100644 --- a/druid-spring-boot-starter/README.md +++ b/druid-spring-boot-starter/README.md @@ -155,6 +155,16 @@ spring.datasource.druid.filter.wall.config.drop-table-allow=false 要想使自定义 Filter 配置生效需要将对应 Filter 的 ```enabled``` 设置为 ```true``` ,Druid Spring Boot Starter 默认会启用 StatFilter,你也可以将其 ```enabled``` 设置为 ```false``` 来禁用它。 +## Spring Boot Actuator Endpoints + +可以使用下面配置类启用 endpoint 默认访问地址:`/druid-endpoint`,可以使用 `endpoints.druid.path=` 自定义终端地址 + +```endpoints.druid.enabled=true``` + +默认需要安全认证才可以访问,可以用下面两种方式之一来禁用安全认证,详情见 Spring Boot 官方文档 + +```endpoints.druid.sensitive=false``` 或 ```management.security.enabled=false``` + ## IDE 提示支持 ![](https://raw.githubusercontent.com/lihengming/java-codes/master/shared-resources/github-images/druid-spring-boot-starter-ide-hint.jpg) diff --git a/druid-spring-boot-starter/README_EN.md b/druid-spring-boot-starter/README_EN.md index 2c026d3ae2..2384facb88 100644 --- a/druid-spring-boot-starter/README_EN.md +++ b/druid-spring-boot-starter/README_EN.md @@ -149,6 +149,14 @@ Currently, configuration support is provided for the following filters. Please r Druid Spring Boot Starter will enable StatFilter by default, and you can also set its enabled to false.,make the Filter configuration take effect and need to set enabled to true. +## Spring Boot Actuator Endpoints + +```endpoints.druid.enabled=true``` + +default endpoint address is : `/druid-endpoint`, can be used `endpoints.druid.path=` to customize it. + + + ## IDE Hints ![](https://raw.githubusercontent.com/lihengming/java-codes/master/shared-resources/github-images/druid-spring-boot-starter-ide-hint.jpg) diff --git a/druid-spring-boot-starter/src/main/java/com/alibaba/druid/spring/boot/autoconfigure/DruidDataSourceWrapper.java b/druid-spring-boot-starter/src/main/java/com/alibaba/druid/spring/boot/autoconfigure/DruidDataSourceWrapper.java index e9c9d9f6ee..8807278f40 100644 --- a/druid-spring-boot-starter/src/main/java/com/alibaba/druid/spring/boot/autoconfigure/DruidDataSourceWrapper.java +++ b/druid-spring-boot-starter/src/main/java/com/alibaba/druid/spring/boot/autoconfigure/DruidDataSourceWrapper.java @@ -24,6 +24,7 @@ import com.alibaba.druid.filter.logging.Slf4jLogFilter; import com.alibaba.druid.filter.stat.StatFilter; import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.wall.WallFilter; + import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; @@ -49,9 +50,7 @@ class DruidDataSourceWrapper extends DruidDataSource implements InitializingBean if (super.getUrl() == null) { super.setUrl(basicProperties.determineUrl()); } - if (super.getDriverClassName() == null) { - super.setDriverClassName(basicProperties.determineDriverClassName()); - } + } @Autowired(required = false)