准备工作:
- 引入jar包
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
- 在application.yml中添加配置
management:
endpoints:
web:
exposure:
include: "*"
使用方式
查看日志配置
GET http://ip:port/actuator/loggers
返回如下结果
image.png
动态修改ROOT的日志级别:
POST http://ip:port/actuator/loggers/ROOT
{
"configuredLevel":"DEBUG"
}
也可以具体到某一个包或者类下面
POST http://ip:port/actuator/loggers/com.xxx.controller.BaseController
{
"configuredLevel":"DEBUG"
}
网友评论