druid 通过filter打印所有可执行的sql
2018-11-27 本文已影响0人
乘以零
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);
}
}