Springboot2 Druid的配置

#Mybatis的配置
#日誌 讓控制檯打印sql語句
logging.level.com.allen.druid.dao=debug

#通過包掃描自定義別名,相等於mybatis的<typeAliases>的子標籤<package name=com.allen.springbootmybatis.bean>
#特別注意指定的包目錄下,不能有重名的類,因爲它是把類名首字母小寫後變成別名即com.allen.springbootmybatis.bean.ScheduleBean別名是scheduleBean
#別名的好處,就是你在xml文件,不用寫類的全限定名,只要寫別名即可
mybatis.type-aliases-package=com.allen.springbootmybatis.bean

#指定Mapper文件路徑與名稱(含匹配),掃描多個路徑,中間以,分開 。支持通配符,建議每個都要以classpath*:開頭
mybatis.mapper-locations=classpath*:mappers/*Mapper.xml


##數據庫連接配置信息
spring.datasource.driverClassName =com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://localhost:3306/my_springboot?serverTimezone=UTC
spring.datasource.username = root
spring.datasource.password = root

##指定數據源類型
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource


###########################Druid配置##########################
#####連接池屬性spring.datasource.druid.xxx=
#啓動連接池,默認開啓
#spring.datasource.druid.enable=true

#使用Druid的數據庫連接信息,我不建議使用此種 + 配置類,除非你對Druid特別熟悉
#spring.datasource.druid.driver=com.mysql.cj.jdbc.Driver#指定driver的類名,默認從jdbc url中自動探測
#spring.datasource.druid.driver-class-name使用這個,不用spring.datasource.druid.driver
#spring.datasource.druid.driver-class-name=com.mysql.cj.jdbc.Driver
#spring.datasource.druid.url=jdbc:mysql://localhost:3306/my_springboot?serverTimezone=UTC
#spring.datasource.druid.username=root
#spring.datasource.druid.password=root

#獲取連接時最大等待時間,單位毫秒
#spring.datasource.druid.max-wait=10
##最大連接數
#spring.datasource.druid.max-active=10
##最小連接池數量
#spring.datasource.druid.min-idle=5

#打開KeepAlive之後的效果
#1>初始化連接池時會填充到minIdle數量。
#2>連接池中的minIdle數量以內的連接,空閒時間超過minEvictableIdleTimeMillis,則會執行keepAlive操作。
#3>當網絡斷開等原因產生的由ExceptionSorter檢測出來的死連接被清除後,自動補充連接到minIdle數量。
#連接池中的minIdle數量以內的連接,空閒時間超過minEvictableIdleTimeMillis,則會執行keepAlive操作
#2次keepAlive操作的時間間隔
#spring.datasource.druid.keep-alive-between-time-millis=50000
#開啓keepAlive操作
spring.datasource.druid.keep-alive=true

###打開PSCache,並指定每個連接上PSCache的大小。oracle設爲true,mysql設爲false。分庫分表較多推薦設置爲false
spring.datasource.druid.pool-prepared-statements=true
spring.datasource.druid.max-pool-prepared-statement-per-connection-size=30

####檢測,驗證
##歸還連接時會執行validationQuery檢測連接是否有效,開啓會降低性能,默認爲true
####如果你的數據庫經常斷,必須使用此配置,否則系統需要重啓(如果數據庫異常有短信這類通知,建議關閉)
spring.datasource.druid.test-on-return=false
##用來檢測連接是否有效的sql 必須是一個查詢語句,spring.datasource.druid.test-on-return設置true才能用
##mysql、oracle中爲 select 1 from dual,不知道爲啥mysql,網上推薦SELECT 'x'
spring.datasource.druid.validation-query=select 1 from dual
##申請連接的時候檢測,如果空閒時間大於timeBetweenEvictionRunsMillis,執行validationQuery檢測連接是否有效。
spring.datasource.druid.test-while-idle=true
## 當從連接池借用連接時,是否測試該連接,建議測試false
spring.datasource.druid.test-on-borrow=false

##既作爲檢測的間隔時間又作爲testWhileIdel執行的依據即此值決定是否空閒,因此此值一定要設置合理
#即一個空閒線程,最大的生成時間。檢測需要關閉的空閒連接
#spring.datasource.druid.time-between-eviction-runs-millis=60000
##銷燬線程時檢測當前連接的最後活動時間和當前時間差大於該值時,關閉當前連接即一個連接在池中最小生存的時間
#spring.datasource.druid.min-evictable-idle-time-millis=3000

#指定連接變量。eg開啓慢sql功能=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
#spring.datasource.druid.connection-properties=String

#合併多個DruidDataSource的監控數據
#spring.datasource.druid.use-global-data-source-stat=true

##允許訪問底層連接
#spring.datasource.druid.access-to-underlying-connection-allowed=true

#活躍連接堆跟蹤
#spring.datasource.druid.active-connection-stack-trace=List<String>

#活躍連接列表
#spring.datasource.druid.active-connections=Set<DruidPooledConnection>



##啓用異步關閉連接
#spring.datasource.druid.async-close-connection-enable=true
#開啓異步初始化
#spring.datasource.druid.async-init=true

#失敗後跳過即用於失敗重連,默認爲false,true表示向數據庫請求連接失敗後,就算後端數據庫恢復正常也不進行重連
#因此一定要配置false
#spring.datasource.druid.break-after-acquire-failure=false

#檢查執行sql執行時間
#spring.datasource.druid.check-execute-time=true

#啓動清除過濾器
#spring.datasource.druid.clear-filters-enable=false


#連接出錯嘗試幾次重新連接
#spring.datasource.druid.connection-error-retry-attempts=2

####連接初始化語句即寫sql語句,連接後會自動執行,用於測試比較好
#spring.datasource.druid.connection-init-sqls=Collection<String>
#spring.datasource.druid.connection-init-sqls=update t_schedule  set status=0

#創建定時器的連接池,跟數據庫連接有關
#spring.datasource.druid.create-scheduler=java.util.concurrent.ScheduledExecutorService

#指定db類型,eg:h2、mysq、oracle
#spring.datasource.druid.db-type=String

#指定默認值:事務是否自動提交
#spring.datasource.druid.default-auto-commit=true

#指定連接默認的catalog.
#spring.datasource.druid.default-catalog=String

#是否設置默認連接只讀.
#spring.datasource.druid.default-read-only=true

#指定連接的事務的默認隔離級別.
#-1 數據庫默認隔離級別
#1 未提交讀
#2 讀寫提交
#4 可重複讀
#8 串行化
#spring.datasource.druid.default-transaction-isolation=Integer

#指定銷燬的定時連接池
#spring.datasource.druid.destroy-scheduler=java.util.concurrent.ScheduledExecutorService

##啓用DUP關閉日誌
#spring.datasource.druid.dup-close-log-enable=true

#當數據庫拋出不可恢復的異常時,拋棄該連接
#spring.datasource.druid.exception-sorter=com.alibaba.druid.pool.ExceptionSorter
#指定ExceptionSorter類名
#spring.datasource.druid.exception-sorter-class-name=String

#當創建連接池時,創建失敗後是否立即拋異常
#spring.datasource.druid.fail-fast=true

#DruidStatProperties的aopPatterns字段即指定AOP模式
#spring.datasource.druid.aop-patterns=String[]
#Spring監控,對內部各接口調用的監控,參考Druid Github Wiki,配置_Druid和Spring關聯監控配置
#spring.datasource.druid.aop-patterns=com.allen.service.*,com.allen.dao.*,com.allen.controller.*,com.allen.mapper.*

###連接池初始化
#開啓線程初始化異常拋出異常
#spring.datasource.druid.init-exception-throw=true

#false #初始化全局變量
#spring.datasource.druid.init-global-variants=true
##初始化變量
#spring.datasource.druid.init-variants=true

##初始化時建立物理連接的個數
#spring.datasource.druid.initial-size=10


#socket連接超時時kil
#spring.datasource.druid.kill-when-socket-read-timeout=true
#記錄丟失
#spring.datasource.druid.log-abandoned=true

#記錄不同的線程
#spring.datasource.druid.log-different-thread=true

#指定連接數據庫的超時時間
#spring.datasource.druid.login-timeout=Integer

#最大創建任務數
#spring.datasource.druid.max-create-task-count=1000
##連接保持空閒而不被驅逐的最大時間.默認值1000L * 60L * 60L * 7,com.alibaba.druid.pool.DruidAbstractDataSource.maxEvictableIdleTimeMillis
#spring.datasource.druid.max-evictable-idle-time-millis=1000

#最大打開的prepared-statement數量
#spring.datasource.druid.max-open-prepared-statements=1000

#允許的最大線程等待數
#spring.datasource.druid.max-wait-thread-count=10

#指定連接池名稱
#spring.datasource.druid.name=String
#設置獲取連接時的重試次數,-1爲不重試
#spring.datasource.druid.not-full-timeout-retry-count=-1

#????
#spring.datasource.druid.object-name=

#用於控制當OnFatalError發生時最大使用連接數量,用於控制異常發生時併發執行SQL的數量,減輕數據庫恢復的壓力。
#默認值 0
#spring.datasource.druid.on-fatal-error-max-active=Integer

#是否是oracle數據庫
#spring.datasource.druid.oracle=false

#用於解決數據庫密碼加密處理方法
#public class AllenDbPasswordCallback extends DruidPasswordCallback {
#   private static final Logger LOGGER = LoggerFactory.getLogger(DbPasswordCallback.class);
#   @Override
#  public void setProperties(Properties properties) {
#       super.setProperties(properties);
#       真實環境,這2個值存數據庫
#       String password = (String) properties.get("password");
#       String publickey = (String) properties.get("publickey");
#  try {
#      String dbpassword = ConfigTools.decrypt(publickey, password);
#              setPassword(dbpassword.toCharArray());
#      } catch (Exception e) {
#        LOGGER.error("Druid ConfigTools.decrypt", e);
#      }
#   }
#}
#spring.datasource.druid.password-callback=javax.security.auth.callback.PasswordCallback

#物理最大連接數
#spring.datasource.druid.phy-max-use-count=1000
#物理超時
#spring.datasource.druid.phy-timeout-millis=Long

#???
#spring.datasource.druid.pooling-connection-info=List<Map<String,Object>>

#指定代理過濾器
#spring.datasource.druid.proxy-filters=List<Filter>

#查詢超時時間
#spring.datasource.druid.query-timeout=Integer

#指定當連接超過廢棄超時時間時,是否立刻刪除該連接.
#spring.datasource.druid.remove-abandoned=true
#指定連接應該被廢棄的時間.
#spring.datasource.druid.remove-abandoned-timeout=Integer

#廢棄連接超時指定時間的連接
#spring.datasource.druid.remove-abandoned-timeout-millis=Long

#啓用重置統計信息
#spring.datasource.druid.reset-stat-enable=true

#共享預處理語句
#spring.datasource.druid.share-prepared-statements=true


#指定2次錯誤連接的最大時間間隔
#spring.datasource.druid.time-between-connect-error-millis=

#統計日誌之間的時間
#spring.datasource.druid.time-between-log-stats-millis=

##事務查詢超時時間
#spring.datasource.druid.transaction-query-timeout=Integer

# 事務時間閾值
#spring.datasource.druid.transaction-threshold-millis=Long

#使用本地session是stat
#spring.datasource.druid.use-local-session-state=true

# 使用oracle隱式緩存
#spring.datasource.druid.use-oracle-implicit-cache=true
# 使用非公平鎖
#spring.datasource.druid.use-unfair-lock=true

#com.alibaba.druid.pool.DruidAbstractDataSource.userCallback
#spring.datasource.druid.user-callback=

#指定連接的有效檢查類
#spring.datasource.druid.valid-connection-checker=com.alibaba.druid.pool.ValidConnectionChecker
#spring.datasource.druid.valid-connection-checker-class-name=String

#單位:秒,檢測連接是否有效的超時時間。底層調用jdbc Statement對象的void setQueryTimeout(int seconds)方法
#spring.datasource.druid.validation-query-timeout=Integer



################################filters#############################################

# 配置擴展插件:配置監控統計攔截的filters,去掉後監控界面sql無法統計,'wall'用於防火牆
#spring.datasource.druid.filters=String

#sql無法統計時,去除wall
#spring.datasource.druid.filters=stat,wall,log4j,config

#允許一次執行多條語句,與spring.datasource.druid.filters的wall值有關
#wall是com.alibaba.druid.wall.WallFilter的簡稱,提供sql的檢查和過濾等功能
# 默認對混合SQL進行攔截,此處爲了執行大SQL,可關閉防火牆功能。
#如果需要開啓wall監控,同時允許multiStatementAllow,就不要在application中配置filter。
#spring.datasource.druid.filter.wall.config.multi-statement-allow=true

####開啓慢sql
##合併sql,默認false
#spring.datasource.druid.filter.stat.merge-sql=true
#spring.datasource.druid.filter.stat.log-slow-sql=true
##sql的執行時間超過1500毫秒就是慢sql
#spring.datasource.druid.filter.stat.slow-sql-millis=1500
####慢sql結束

#druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
#spring.datasource.druid.connect-properties=Map<String,String>
#eg:開啓慢sql的另一種方式
#spring.datasource.druid.connect-properties.=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000


#指定過濾器名稱
#spring.datasource.druid.filter-class-names=List<String>

#啓用Enable ConfigFilter
#spring.datasource.druid.filter.config.enabled=true

#啓用EncodingConvertFilter
#spring.datasource.druid.filter.encoding.enabled=true

#???
#spring.datasource.druid.sql-stat-map.=Map<String,JdbcSqlStat>

#???
#spring.datasource.druid.stat-data.=Map<String,Object>

#????
#spring.datasource.druid.stat-data-for-m-bean.=Map<String,Object>

##################################stat######################################

#啓用
#spring.datasource.druid.filter.stat.enabled=true

#指定stat的logger實現類
#spring.datasource.druid.stat-logger=com.alibaba.druid.pool.DruidDataSourceStatLogger

#指定stat的數據庫類型
#spring.datasource.druid.filter.stat.db-type=mysql

#啓動連接堆跟蹤,com.alibaba.druid.filter.stat.StatFilter的connectionStackTraceEnable字段,默認false
#spring.datasource.druid.filter.stat.connection-stack-trace-enable=true


###############################stat-view-servlet#######################

# 白名單 ;com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties.StatViewServlet#allow
#spring.datasource.druid.stat-view-servlet.allow=String

#黑名單
#spring.datasource.druid.stat-view-servlet.deny=String

#開啓
#spring.datasource.druid.stat-view-servlet.enabled=true
#登錄密碼
#spring.datasource.druid.stat-view-servlet.login-password=
#登錄用戶名
#spring.datasource.druid.stat-view-servlet.login-username=
#啓用重置統計信息
#spring.datasource.druid.stat-view-servlet.reset-enable=String
##訪問路徑
#spring.datasource.druid.stat-view-servlet.url-pattern=String


###############################web-stat-filter#######################
#啓用開關
#spring.datasource.druid.web-stat-filter.enabled=true
# #排除URL  com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties.WebStatFilter
#spring.datasource.druid.web-stat-filter.exclusions= *.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*

#身份標識 從session中獲取spring.datasource.druid.web-stat-filter.principal-session-name=身份標識
# 從cookie中獲取 例如cookie中存gk=xiaoming 設置屬性爲gk即可
#spring.datasource.druid.web-stat-filter.principal-session-name=String
#spring.datasource.druid.web-stat-filter.principal-cookie-name=

#配置profileEnable能夠監控單個url調用的sql列表
# com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties.WebStatFilter.profileEnable
#spring.datasource.druid.web-stat-filter.profile-enable=String true
#開關session統計功
#spring.datasource.druid.web-stat-filter.session-stat-enable=true

# 默認sessionStatMaxCount是1000個,你也可以按需要進行配置
#spring.datasource.druid.web-stat-filter.session-stat-max-count=

#statFilter的url模式,支持正則表達式
#spring.datasource.druid.web-stat-filter.url-pattern=/*
# 排除一些不必要的url,比如.js,/jslib/等等
#spring.datasource.druid.web-stat-filter.exclusions=*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*



###############################防火牆開始filter.wall###############################

#開啓Wall功能
#spring.datasource.druid.filter.wall.enabled=true
#Map<String,Object>
#spring.datasource.druid.wall-stat-map.=allen=java.lang.String;gk=allen

#是否允許執行Alter Table語句
#spring.datasource.druid.filter.wall.config.alter-table-allow=true

#是否允許阻塞
#spring.datasource.druid.filter.wall.config.block-allow=true

#是否允許通過jdbc的call語法調用存儲過程
#spring.datasource.druid.filter.wall.config.call-allow=true

#com.alibaba.druid.wall.WallConfig.caseConditionConstAllow
#spring.datasource.druid.filter.wall.config.case-condition-const-allow=true

#默認false 是否允許語句中存在註釋,Oracle的用戶不用擔心,Wall能夠識別hints和註釋的區別
#spring.datasource.druid.filter.wall.config.comment-allow=true
#默認true 是否允許執行commit操作
#spring.datasource.druid.filter.wall.config.commit-allow=true

# 默認值:false   ??
#spring.datasource.druid.filter.wall.config.complete-insert-values-check=true

#默認值false。檢查查詢條件(WHERE/HAVING子句)中是否包含AND永假條件
#spring.datasource.druid.filter.wall.config.condition-and-alway-false-allow=true

#默認值false:檢查查詢條件(WHERE/HAVING子句)中是否包含AND永真條件
#spring.datasource.druid.filter.wall.config.condition-and-alway-true-allow=true

#默認值false 查詢條件中是否允許連續兩個常量運算表達式
#spring.datasource.druid.filter.wall.config.condition-double-const-allow=true

#默認值true,檢查查詢條件(WHERE/HAVING子句)中是否包含LIKE永真條件
#spring.datasource.druid.filter.wall.config.condition-like-true-allow=true

#默認值:true。查詢條件中是否允許有"&"、"~"、"|"、"^"運算符。
#spring.datasource.druid.filter.wall.config.condition-op-bitwse-allow=true

#默認值:false 查詢條件中是否允許有XOR條件。XOR不常用,很難判斷永真或者永假,缺省不允許。
#spring.datasource.druid.filter.wall.config.condition-op-xor-allow=true

#默認值true。攔截常量運算的條件,比如說WHERE FID = 3 - 1,其中"3 - 1"是常量運算表達式。
#spring.datasource.druid.filter.wall.config.const-arithmetic-allow=true

#默認值true,是否允許創建表
#spring.datasource.druid.filter.wall.config.create-table-allow=true

#默認值true,是否允許執行DELETE語句
#spring.datasource.druid.filter.wall.config.delete-allow=true

#默認true,檢查DELETE語句的WHERE子句是否是一個永真條件
#spring.datasource.druid.filter.wall.config.delete-where-alway-true-check=true

#false,檢查DELETE語句是否無where條件,這是有風險的,但不是SQL注入類型的風險
#spring.datasource.druid.filter.wall.config.delete-where-none-check=true

#???com.alibaba.druid.wall.WallConfig.denyFunctions
#spring.datasource.druid.filter.wall.config.deny-functions=Set<String>

#com.alibaba.druid.wall.WallConfig.denyObjects
#spring.datasource.druid.filter.wall.config.deny-objects=Set<String>

#com.alibaba.druid.wall.WallConfig.denySchemas
#spring.datasource.druid.filter.wall.config.deny-schemas=Set<String>

#com.alibaba.druid.wall.WallConfig.denyTables
#spring.datasource.druid.filter.wall.config.deny-tables=Set<String>


#com.alibaba.druid.wall.WallConfig.denyVariants
#spring.datasource.druid.filter.wall.config.deny-variants=

#true 是否允許執行mysql的describe語句,缺省打開
#spring.datasource.druid.filter.wall.config.describe-allow=true

#按照dbType分別配置: mysql : META-INF/druid/wall/mysql oracle : META-INF/druid/wall/oracle sqlserver : META-INF/druid/wall/sqlserver
#spring.datasource.druid.filter.wall.config.dir=String

#false,特權允許
#spring.datasource.druid.filter.wall.config.do-privileged-allow=true

#true 是否允許修改表
#spring.datasource.druid.filter.wall.config.drop-table-allow=true

#true,檢測是否使用了禁用的函數
#spring.datasource.druid.filter.wall.config.function-check=true

#spring.datasource.druid.filter.wall.config.hint-allow=true

#???
#spring.datasource.druid.filter.wall.config.inited=true

#true,是否允許執行INSERT語句
#spring.datasource.druid.filter.wall.config.insert-allow=true


#默認值3
#spring.datasource.druid.filter.wall.config.insert-values-check-size=Integer

#true,是否允許SELECT FROM A INTERSECT SELECT FROM B這樣的語句
#spring.datasource.druid.filter.wall.config.intersect-allow=true

#false,是否允許limit 0這樣的語句
#spring.datasource.druid.filter.wall.config.limit-zero-allow=true

#true,鎖表允許
#spring.datasource.druid.filter.wall.config.lock-table-allow=true

#true,是否允許執行MERGE語句,這個只在Oracle中有用
#spring.datasource.druid.filter.wall.config.merge-allow=true

#true,是否允許調用Connection.getMetadata方法,這個方法調用會暴露數據庫的表信息
#spring.datasource.druid.filter.wall.config.metadata-allow=true

#true,是否允許SELECT FROM A MINUS SELECT FROM B這樣的語句
#spring.datasource.druid.filter.wall.config.minus-allow=true

#false。是否必須參數化,如果爲True,則不允許類似WHERE ID = 1這種不參數化的SQL
#spring.datasource.druid.filter.wall.config.must-parameterized=true

#false。是否允許非以上基本語句的其他語句,缺省關閉,通過這個選項就能夠屏蔽DDL。
#spring.datasource.druid.filter.wall.config.none-base-statement-allow=true

#true,檢測是否使用了“禁用對對象”
#spring.datasource.druid.filter.wall.config.object-check=true

#???
#spring.datasource.druid.filter.wall.config.permit-functions=Set<String>

# 允許的schemas集合
#spring.datasource.druid.filter.wall.config.permit-schemas=Set<String>

#允許table名集合
#spring.datasource.druid.filter.wall.config.permit-tables=Set<String>

#允許變量集合
#spring.datasource.druid.filter.wall.config.permit-variants=Set<String>

#只允許讀的表
#spring.datasource.druid.filter.wall.config.read-only-tables=Set<String>

#true。是否允許表重命名
#spring.datasource.druid.filter.wall.config.rename-table-allow=true

#true。是否允許執行REPLACE語句
#spring.datasource.druid.filter.wall.config.replace-allow=true

#true。是否允許執行roll back操作
#spring.datasource.druid.filter.wall.config.rollback-allow=true

#true,檢測是否使用了禁用的Schema
#spring.datasource.druid.filter.wall.config.schema-check=true

# ??? true,不允許執行select * from t,但select from (select id, name from t) a。
# 這個選項是防禦程序通過調用select 獲得數據表的結構信息。
#spring.datasource.druid.filter.wall.config.select-all-column-allow=true

#true,檢測SELECT EXCEPT
#spring.datasource.druid.filter.wall.config.select-except-check=true

#true,檢查SELECT語句的HAVING子句是否是一個永真條件
#spring.datasource.druid.filter.wall.config.select-having-alway-true-check=true

#true,檢測SELECT INTERSECT
#spring.datasource.druid.filter.wall.config.select-intersect-check=true

#true,SELECT查詢中是否允許INTO字句
#spring.datasource.druid.filter.wall.config.select-into-allow=true

#true.SELECT … INTO OUTFILE 是否允許,這個是mysql注入攻擊的常見手段,缺省是禁止的
#spring.datasource.druid.filter.wall.config.select-into-outfile-allow=true

#默認值-1;配置最大返回行數,如果select語句沒有指定最大返回行數,會自動修改selct添加返回限制
#spring.datasource.druid.filter.wall.config.select-limit=Integer

#true,檢測SELECT MINUS
#spring.datasource.druid.filter.wall.config.select-minus-check=true

#true,檢測SELECT union
#spring.datasource.druid.filter.wall.config.select-union-check=true

#true,檢查SELECT語句的WHERE子句是否是一個永真條件
#spring.datasource.druid.filter.wall.config.select-where-alway-true-check=true

#true,是否允許執行SELECT語句
#spring.datasource.druid.filter.wall.config.selelct-allow=true
#true.是否允許使用SET語法
#spring.datasource.druid.filter.wall.config.set-allow=true

#true.是否允許執行mysql的show語句,缺省打開
#spring.datasource.druid.filter.wall.config.show-allow=true

#true.是否允許開啓事務
#spring.datasource.druid.filter.wall.config.start-transaction-allow=true

#true, 是否進行嚴格的語法檢測,
# Druid SQL Parser在某些場景不能覆蓋所有的SQL語法,出現解析SQL出錯,可以臨時把這個選項設置爲false,同時把SQL反饋給Druid的開發者。
#spring.datasource.druid.filter.wall.config.strict-syntax-check=true

#true,檢測是否使用了禁用的表
#spring.datasource.druid.filter.wall.config.table-check=true

#??
#spring.datasource.druid.filter.wall.config.tenant-column=String
#???
#spring.datasource.druid.filter.wall.config.tenant-table-pattern=String

#true,truncate語句是危險,缺省打開,若需要自行關閉
#spring.datasource.druid.filter.wall.config.truncate-allow=true

#true,是否允許update語法
#spring.datasource.druid.filter.wall.config.update-allow=true

#指定UpdateCheck處理器
#spring.datasource.druid.filter.wall.config.update-check-handler=com.alibaba.druid.wall.WallUpdateCheckHandler

#true.檢查UPDATE語句的WHERE子句是否是一個永真條件
#spring.datasource.druid.filter.wall.config.update-where-alay-true-check=true

#false,檢查UPDATE語句是否無where條件,這是有風險的,但不是SQL注入類型的風險
#spring.datasource.druid.filter.wall.config.update-where-none-check=true

#true,是否允許執行mysql的use語句,缺省打開
#spring.datasource.druid.filter.wall.config.use-allow=true

#true.檢測是否使用了“禁用的變量”
#spring.datasource.druid.filter.wall.config.variant-check=true

#true,是否允許調用Connection/Statement/ResultSet的isWrapFor和unwrap方法,
# 這兩個方法調用,使得有辦法拿到原生驅動的對象,繞過WallFilter的檢測直接執行SQL。
#spring.datasource.druid.filter.wall.config.wrap-allow=true

#指定Wall的配置類,可以繼承WallConfig類,然後指定即可
#spring.datasource.druid.filter.wall.config=com.alibaba.druid.wall.WallConfig

#指定數據庫類型,mysql
#spring.datasource.druid.filter.wall.db-type=String

#默認false,對被認爲是攻擊的SQL進行LOG.error輸出
#spring.datasource.druid.filter.wall.log-violation=true

#provider 白名單 ???
#spring.datasource.druid.filter.wall.provider-white-list=Set<String>
#???
#spring.datasource.druid.filter.wall.tenant-column=String

#true,對被認爲是攻擊的SQL拋出SQLException
#spring.datasource.druid.filter.wall.throw-exception=true
###防火牆結束



###################################日誌的處理###################################

########################commons-log 日誌開始#####################
#spring.datasource.druid.filter.commons-log.connection-close-after-log-enabled=true
#spring.datasource.druid.filter.commons-log.connection-commit-after-log-enabled=true
#spring.datasource.druid.filter.commons-log.connection-connect-after-log-enabled=true
#spring.datasource.druid.filter.commons-log.connection-connect-before-log-enabled=true
#spring.datasource.druid.filter.commons-log.connection-log-enabled=true
#spring.datasource.druid.filter.commons-log.connection-log-error-enabled=true
#spring.datasource.druid.filter.commons-log.connection-logger-name=
#spring.datasource.druid.filter.commons-log.connection-rollback-after-log-enabled=true
#spring.datasource.druid.filter.commons-log.data-source-log-enabled=true
#spring.datasource.druid.filter.commons-log.data-source-logger-name=
#spring.datasource.druid.filter.commons-log.enabled=true
#spring.datasource.druid.filter.commons-log.result-set-close-after-log-enabled=true
#spring.datasource.druid.filter.commons-log.result-set-log-enabled=true
#spring.datasource.druid.filter.commons-log.result-set-log-error-enabled=true
#spring.datasource.druid.filter.commons-log.result-set-logger-name=
#spring.datasource.druid.filter.commons-log.result-set-next-after-log-enabled=true
#spring.datasource.druid.filter.commons-log.result-set-open-after-log-enabled=true
#spring.datasource.druid.filter.commons-log.statement-close-after-log-enabled=true
#spring.datasource.druid.filter.commons-log.statement-create-after-log-enabled=true
#spring.datasource.druid.filter.commons-log.statement-executable-sql-log-enable=true
#spring.datasource.druid.filter.commons-log.statement-execute-after-log-enabled=true
#spring.datasource.druid.filter.commons-log.statement-execute-batch-after-log-enabled=true
#spring.datasource.druid.filter.commons-log.statement-execute-query-after-log-enabled=true
#spring.datasource.druid.filter.commons-log.statement-execute-update-after-log-enabled=true
#spring.datasource.druid.filter.commons-log.statement-log-enabled=true
#spring.datasource.druid.filter.commons-log.statement-log-error-enabled=true
#spring.datasource.druid.filter.commons-log.statement-logger-name=
#spring.datasource.druid.filter.commons-log.statement-parameter-clear-log-enable=true
#spring.datasource.druid.filter.commons-log.statement-parameter-set-log-enabled=true
#spring.datasource.druid.filter.commons-log.statement-prepare-after-log-enabled=true
#spring.datasource.druid.filter.commons-log.statement-prepare-call-after-log-enabled=true
#spring.datasource.druid.filter.commons-log.statement-sql-format-option=
#spring.datasource.druid.filter.commons-log.statement-sql-pretty-format=true
##commons-log 日誌結束


########################日誌log4j開始 日誌開始#####################
###
#spring.datasource.druid.filter.log4j.connection-close-after-log-enabled=true
#spring.datasource.druid.filter.log4j.connection-commit-after-log-enabled=true
#spring.datasource.druid.filter.log4j.connection-connect-after-log-enabled=true
#spring.datasource.druid.filter.log4j.connection-connect-before-log-enabled=true
#spring.datasource.druid.filter.log4j.connection-log-enabled=true
#spring.datasource.druid.filter.log4j.connection-log-error-enabled=true
#spring.datasource.druid.filter.log4j.connection-logger-name=
#spring.datasource.druid.filter.log4j.connection-rollback-after-log-enabled=true
#spring.datasource.druid.filter.log4j.data-source-log-enabled=true
#spring.datasource.druid.filter.log4j.data-source-logger-name=
#spring.datasource.druid.filter.log4j.enabled=true
#spring.datasource.druid.filter.log4j.result-set-close-after-log-enabled=true
#spring.datasource.druid.filter.log4j.result-set-log-enabled=true
#spring.datasource.druid.filter.log4j.result-set-log-error-enabled=true
#spring.datasource.druid.filter.log4j.result-set-logger-name=
#spring.datasource.druid.filter.log4j.result-set-next-after-log-enabled=true
#spring.datasource.druid.filter.log4j.result-set-open-after-log-enabled=true
#spring.datasource.druid.filter.log4j.statement-close-after-log-enabled=true
#spring.datasource.druid.filter.log4j.statement-create-after-log-enabled=true
#spring.datasource.druid.filter.log4j.statement-executable-sql-log-enable=true
#spring.datasource.druid.filter.log4j.statement-execute-after-log-enabled=true
#spring.datasource.druid.filter.log4j.statement-execute-batch-after-log-enabled=true
#spring.datasource.druid.filter.log4j.statement-execute-query-after-log-enabled=true
#spring.datasource.druid.filter.log4j.statement-execute-update-after-log-enabled=true
#spring.datasource.druid.filter.log4j.statement-log-enabled=true
#spring.datasource.druid.filter.log4j.statement-log-error-enabled=true
#spring.datasource.druid.filter.log4j.statement-logger-name=
#spring.datasource.druid.filter.log4j.statement-parameter-clear-log-enable=true
#spring.datasource.druid.filter.log4j.statement-parameter-set-log-enabled=true
#spring.datasource.druid.filter.log4j.statement-prepare-after-log-enabled=true
#spring.datasource.druid.filter.log4j.statement-prepare-call-after-log-enabled=true
#spring.datasource.druid.filter.log4j.statement-sql-format-option=
#spring.datasource.druid.filter.log4j.statement-sql-pretty-format=true
###日誌log4j結束

########################日誌log4j2日誌開始#####################
###
#spring.datasource.druid.filter.log4j2.connection-close-after-log-enabled=true
#spring.datasource.druid.filter.log4j2.connection-commit-after-log-enabled=true
#spring.datasource.druid.filter.log4j2.connection-connect-after-log-enabled=true
#spring.datasource.druid.filter.log4j2.connection-connect-before-log-enabled=true
#spring.datasource.druid.filter.log4j2.connection-log-enabled=true
#spring.datasource.druid.filter.log4j2.connection-log-error-enabled=true
#spring.datasource.druid.filter.log4j2.connection-logger-name=
#spring.datasource.druid.filter.log4j2.connection-rollback-after-log-enabled=true
#spring.datasource.druid.filter.log4j2.data-source-log-enabled=true
#spring.datasource.druid.filter.log4j2.data-source-logger-name=
#spring.datasource.druid.filter.log4j2.enabled=true
#spring.datasource.druid.filter.log4j2.result-set-close-after-log-enabled=true
#spring.datasource.druid.filter.log4j2.result-set-log-enabled=true
#spring.datasource.druid.filter.log4j2.result-set-log-error-enabled=true
#spring.datasource.druid.filter.log4j2.result-set-logger-name=
#spring.datasource.druid.filter.log4j2.result-set-next-after-log-enabled=true
#spring.datasource.druid.filter.log4j2.result-set-open-after-log-enabled=true
#spring.datasource.druid.filter.log4j2.statement-close-after-log-enabled=true
#spring.datasource.druid.filter.log4j2.statement-create-after-log-enabled=true
#spring.datasource.druid.filter.log4j2.statement-executable-sql-log-enable=true
#spring.datasource.druid.filter.log4j2.statement-execute-after-log-enabled=true
#spring.datasource.druid.filter.log4j2.statement-execute-batch-after-log-enabled=true
#spring.datasource.druid.filter.log4j2.statement-execute-query-after-log-enabled=true
#spring.datasource.druid.filter.log4j2.statement-execute-update-after-log-enabled=true
#spring.datasource.druid.filter.log4j2.statement-log-enabled=true
#spring.datasource.druid.filter.log4j2.statement-log-error-enabled=true
#spring.datasource.druid.filter.log4j2.statement-logger-name=
#spring.datasource.druid.filter.log4j2.statement-parameter-clear-log-enable=true
#spring.datasource.druid.filter.log4j2.statement-parameter-set-log-enabled=true
#spring.datasource.druid.filter.log4j2.statement-prepare-after-log-enabled=true
#spring.datasource.druid.filter.log4j2.statement-prepare-call-after-log-enabled=true
#spring.datasource.druid.filter.log4j2.statement-sql-format-option=
#spring.datasource.druid.filter.log4j2.statement-sql-pretty-format=true
###日誌log4j2結束
發佈了152 篇原創文章 · 獲贊 7 · 訪問量 1萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章