引入依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
配置文件添加
management.endpoints.web.exposure.include= loggers
之后访问
http://localhost:8080/xxx/actuator/loggers
即可看到每个文件的日志级别
查看某个目录的日志级别
http://localhost:8080/xxx/actuator/loggers](http://localhost:8080/rose-server/actuator/loggers/{目录名}
可以配置指定目录的日志级别
post请求修改指定目录日志级别:
http://localhost:8080/xxx/actuator/loggers/{目录名}
请求提
{
"configuredLevel": "debug"
}
再次查看此目录的日志级别发现已被修改
http://localhost:8080/xxx/actuator/loggers](http://localhost:8080/rose-server/actuator/loggers/{目录名}