add 集成 spring-boot-admin 全方位监控

This commit is contained in:
疯狂的狮子li
2021-04-22 15:04:35 +08:00
parent 5b4e9ef4db
commit 5fcef39a2e
10 changed files with 137 additions and 5 deletions

View File

@ -43,8 +43,8 @@ spring:
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username:
login-password:
login-username: ruoyi
login-password: 123456
filter:
stat:
enabled: true

View File

@ -57,6 +57,7 @@ logging:
level:
com.ruoyi: @logging.level@
org.springframework: warn
config: classpath:logback.xml
# Spring配置
spring:
@ -78,6 +79,33 @@ spring:
restart:
# 热部署开关
enabled: true
application:
name: ruoyi-vue-plus
boot:
admin:
# Spring Boot Admin Client 客户端的相关配置
client:
# 设置 Spring Boot Admin Server 地址
url: http://localhost:${server.port}${spring.boot.admin.context-path}
instance:
prefer-ip: true # 注册实例时,优先使用 IP
# username: ruoyi
# password: 123456
# Spring Boot Admin Server 服务端的相关配置
context-path: /admin # 配置 Spring
# Actuator 监控端点的配置项
management:
endpoints:
web:
# Actuator 提供的 API 接口的根目录。默认为 /actuator
base-path: /actuator
exposure:
# 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
include: '*'
endpoint:
logfile:
external-file: ./logs/sys-console.log
# token配置
token:

View File

@ -12,6 +12,19 @@
<charset>utf-8</charset>
</encoder>
</appender>
<!-- 控制台输出 -->
<appender name="file_console" class="ch.qos.logback.core.FileAppender">
<file>${log.path}/sys-console.log</file>
<encoder>
<pattern>${log.pattern}</pattern>
<charset>utf-8</charset>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<!-- 过滤的级别 -->
<level>INFO</level>
</filter>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
@ -85,6 +98,7 @@
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
<appender-ref ref="file_console" />
</root>
<!--系统用户操作日志-->