alibaba / druid

阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
https://github.com/alibaba/druid/wiki
Apache License 2.0
27.97k stars 8.58k forks source link

spring.datasource.druid.filters can't be autowired! #2542

Open liuhaozzu opened 6 years ago

liuhaozzu commented 6 years ago

problem: it seems that the spring.datasource.filters property can't be autowired. it's very strange that the filters is autowired by this way: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceWrapper#addStatFilter ... Why didn't we get it directly? It's seems that the way to config the sql monitor has been changed. Where can I find the wiki of this part?

ps: affected version:

<dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid-spring-boot-starter</artifactId>
            <version>1.1.9</version>
        </dependency>
lihengming commented 6 years ago

spring.datasource.druid.filters=stat,wall,log4j ... is default filter,if config custom filter you can use spring.datasource.druid.filter.*, detail see doc : https://github.com/alibaba/druid/tree/master/druid-spring-boot-starter#%E5%A6%82%E4%BD%95%E9%85%8D%E7%BD%AE-filter

lihengming commented 6 years ago

com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceWrapper#addStatFilter work for spring.datasource.druid.filter.* property.

lihengming commented 6 years ago

see #2507