datasource:
druid:
filter:
wall:
config:
comment-allow: true
这边打了断点并没有走进来
sql 执行时 config.isCommentAllow() = false
这是druid相关所有配置
datasource:
druid:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
# driver-class-name: com.p6spy.engine.spy.P6SpyDriver
url: jdbc:mysql://****:**/**?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8
username:**
password:**
initial-size: 5
min-idle: 5
max-active: 20
max-wait: 30000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
validation-query: select '1' from dual
test-while-idle: true
test-on-borrow: false
test-on-return: false
pool-prepared-statements: true
max-open-prepared-statements: 20
max-pool-prepared-statement-per-connection-size: 20
filters: stat,slf4j,wall
web-stat-filter:
enabled: true
url-pattern: /*
exclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
stat-view-servlet:
enabled: true
url-pattern: /druid/*
reset-enable: false
login-username:**
login-password:**
filter:
stat:
enabled: true
log-slow-sql: true
slow-sql-millis: 1000
db-type: mysql
merge-sql: true
slf4j:
enabled: true
statement-create-after-log-enabled: false
statement-log-enabled: false
statement-executable-sql-log-enable: true
statement-log-error-enabled: true
result-set-log-enabled: true
wall:
config:
comment-allow: true
6条答案
按热度按时间q9rjltbz1#
版本为1.1.21
gudnpqoy2#
这样配置
q9rjltbz3#
我遇到类似问题,尝试后发现移除
spring.datasource.druid.filters=stat,wall,log4j
使用以下方式分开配置
就可以了
z0qdvdin4#
我遇到类似问题,尝试后发现移除
spring.datasource.druid.filters=stat,wall,log4j
使用以下方式分开配置
就可以了
there is no need to remove
spring.datasource.druid.filters=stat,wall,log4j
.spring.datasource.druid.filter.wall.enabled=true
is already enough to makewall.config.comment-allow
work.0lvr5msh5#
后来解决了吗,怎么解决的,可以分享下吗
2skhul336#
后来解决了吗,怎么解决的,可以分享下吗
版本: 1.1.21
yml 配置成这样,就可以:
datasource:
druid:
filter:
wall:
enabled: true
config:
comment-allow: true