feat: druid监控配置
This commit is contained in:
+1
@@ -3,6 +3,7 @@ package cn.odboy.mybatis.config;
|
||||
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
|
||||
import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
|
||||
import com.alibaba.druid.util.Utils;
|
||||
import org.springframework.aop.support.JdkRegexpMethodPointcut;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
|
||||
@@ -84,8 +84,14 @@ spring:
|
||||
# 检测连接是否有效
|
||||
validation-query: SELECT 1
|
||||
# 配置监控统计
|
||||
webStatFilter:
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
url-pattern: /*
|
||||
# 开启session统计功能
|
||||
session-stat-enable: true
|
||||
exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
|
||||
# 缺省sessionStatMaxCount是1000个
|
||||
session-stat-max-count: 1000
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
@@ -100,6 +106,7 @@ spring:
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
aop-patterns: "cn.odboy.mapper.*,cn.odboy.service.*,cn.odboy.*.mapper.*,cn.odboy.*.service.*"
|
||||
redis:
|
||||
database: ${REDIS_DB:1}
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
|
||||
@@ -69,8 +69,14 @@ spring:
|
||||
# 检测连接是否有效
|
||||
validation-query: SELECT 1
|
||||
# 配置监控统计
|
||||
webStatFilter:
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
url-pattern: /*
|
||||
# 开启session统计功能
|
||||
session-stat-enable: true
|
||||
exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
|
||||
# 缺省sessionStatMaxCount是1000个
|
||||
session-stat-max-count: 1000
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
@@ -85,6 +91,7 @@ spring:
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
aop-patterns: "cn.odboy.mapper.*,cn.odboy.service.*,cn.odboy.*.mapper.*,cn.odboy.*.service.*"
|
||||
redis:
|
||||
database: ${REDIS_DB:1}
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
|
||||
@@ -336,6 +336,12 @@
|
||||
<artifactId>transmittable-thread-local</artifactId>
|
||||
<version>2.14.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- druid spring监控 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
Reference in New Issue
Block a user