diff --git a/druid-spring-boot-example/druid-spring-boot-mybatis-example/src/main/resources/application.yml b/druid-spring-boot-example/druid-spring-boot-mybatis-example/src/main/resources/application.yml index bc65e79..b2dc45f 100644 --- a/druid-spring-boot-example/druid-spring-boot-mybatis-example/src/main/resources/application.yml +++ b/druid-spring-boot-example/druid-spring-boot-mybatis-example/src/main/resources/application.yml @@ -16,10 +16,9 @@ spring: ansi: enabled: detect datasource: - driver-class-name: org.h2.Driver url: jdbc:h2:file:./samples username: root - password: Biyu5YzU+6sxDRbmWEa3B2uUcImzDo0BuXjTlL505+/pTb+/0Oqd3ou1R6J8+9Fy3CYrM18nBDqf6wAaPgUGOg== + password: 123456 schema: classpath:/import.sql druid: # spring.datasource.druid 前缀的配置将注入到 DruidDataSource2Support,作为公共参数 @@ -37,10 +36,11 @@ spring: pool-prepared-statements: true max-open-prepared-statements: 20 use-global-data-source-stat: true + # 默认开启,当前已开启 stat: - db-type: h2 log-slow-sql: true slow-sql-millis: 1000 + # 默认关闭,需手动开启,当前已开启 slf4j: enabled: true connection-log-enabled: false @@ -49,17 +49,25 @@ spring: pretty-format: false statement-executable-sql-log-enable: true result-set-log-enabled: false + # 默认关闭,需手动开启,当前已开启 wall: enabled: true - db-type: h2 log-violation: true throw-exception: false config: delete-where-none-check: true + # 默认关闭,需手动开启,当前已关闭 config: - enabled: true + enabled: false + # 默认关闭,需手动开启,当前已关闭 + web-stat: + enabled: false + # 默认关闭,需手动开启,当前已关闭 + aop-stat: + enabled: false + # 默认关闭,需手动开启,当前已关闭 stat-view-servlet: - enabled: true + enabled: false transaction: rollback-on-commit-failure: true aop: @@ -105,6 +113,64 @@ spring: --- +spring: + profiles: config + datasource: + url: jdbc:h2:file:./samples + username: root + password: Biyu5YzU+6sxDRbmWEa3B2uUcImzDo0BuXjTlL505+/pTb+/0Oqd3ou1R6J8+9Fy3CYrM18nBDqf6wAaPgUGOg== + schema: classpath:/import.sql + druid: + config: + enabled: true + +--- + +spring: + profiles: features + datasource: + url: jdbc:h2:file:./samples + username: root + password: Biyu5YzU+6sxDRbmWEa3B2uUcImzDo0BuXjTlL505+/pTb+/0Oqd3ou1R6J8+9Fy3CYrM18nBDqf6wAaPgUGOg== + schema: classpath:/import.sql + druid: + # 默认开启,当前已开启 + stat: + log-slow-sql: true + slow-sql-millis: 1000 + # 默认关闭,需手动开启,当前已开启 + slf4j: + enabled: true + connection-log-enabled: false + statement-sql-format-option: + upp-case: true + pretty-format: false + statement-executable-sql-log-enable: true + result-set-log-enabled: false + # 默认关闭,需手动开启,当前已开启 + wall: + enabled: true + log-violation: true + throw-exception: false + config: + delete-where-none-check: true + # 默认关闭,需手动开启,当前已开启 + config: + enabled: true + # 默认关闭,需手动开启,当前已开启 + web-stat: + enabled: true + # 默认关闭,需手动开启,当前已开启 + aop-stat: + enabled: true + patterns: + - com.github.trang.* + # 默认关闭,需手动开启,当前已开启 + stat-view-servlet: + enabled: true + reset-enable: true +--- + debug: false spring: diff --git a/druid-spring-boot-example/druid-spring-boot-mybatis-example/src/main/resources/druid.yml b/druid-spring-boot-example/druid-spring-boot-mybatis-example/src/main/resources/druid.yml index 4bd9259..925cf20 100644 --- a/druid-spring-boot-example/druid-spring-boot-mybatis-example/src/main/resources/druid.yml +++ b/druid-spring-boot-example/druid-spring-boot-mybatis-example/src/main/resources/druid.yml @@ -1,3 +1,5 @@ +# 此文件为 druid 的全自动配置说明,只供参考,不会加载到 spring environment,可随意删除 + # 单数据源,多数据源的配置请看下方 spring: datasource: