Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用 Starter 如何自定义 Druid 的 Filter? #1823

Closed
drtrang opened this issue Jul 11, 2017 · 2 comments
Closed

使用 Starter 如何自定义 Druid 的 Filter? #1823

drtrang opened this issue Jul 11, 2017 · 2 comments

Comments

@drtrang
Copy link

drtrang commented Jul 11, 2017

我想自定义 StatFilter,没看到相关配置

@wenshao
Copy link
Member

wenshao commented Jul 11, 2017

@lihengming

@lihengming
Copy link
Contributor

@drtrang 使用 V1.1.1 版本的DruidDataSourceBuilder,创建数据源后,自行添加自定义Filter。

 @Bean
    public DataSource dataSourceOne(Environment env){
        DruidDataSource dataSource = DruidDataSourceBuilder
                .create()
                .build(env, "spring.datasource.druid");
        dataSource.setProxyFilters(你的Filters);
        return dataSource;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants