druid 通过filter打印所有可执行的sql

public class ExecuteSqlFilter extends Log4jFilter implements InitializingBean {
    private Logger statementLogger = LoggerFactory.getLogger(ExecuteSqlFilter.class);

    public ExecuteSqlFilter() {
        this.setStatementExecutableSqlLogEnable(true);
        this.setResultSetLogEnabled(false);
        this.setConnectionLogEnabled(false);
        this.setDataSourceLogEnabled(false);
        this.setStatementCreateAfterLogEnabled(false);
        this.setStatementPrepareAfterLogEnabled(false);
        this.setStatementPrepareCallAfterLogEnabled(false);
        this.setStatementExecuteAfterLogEnabled(false);
        this.setStatementExecuteQueryAfterLogEnabled(false);
        this.setStatementExecuteUpdateAfterLogEnabled(false);
        this.setStatementExecuteBatchAfterLogEnabled(false);
        this.setStatementCloseAfterLogEnabled(false);
        this.setStatementParameterSetLogEnabled(false);
        this.setStatementParameterClearLogEnable(false);
        this.setStatementLogErrorEnabled(false);
    }
}

你可能感兴趣的:(druid 通过filter打印所有可执行的sql)