动态调整日志级别
配置springboot-actuator
在pom文件中引入依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId></dependency>
在配置文件中开启loggers的endPoint端点
management: endpoints: web: exposure: include: loggers
查询日志级别
查看当前应用所有日志级别
curl http://localhost:8080/actuator/loggers
查看指定包/类日志级别
curl http://localhost:8080/actuator/loggers/ROOT
调整日志级别
curl -X POST -H "Content-Type: application/vnd.spring-boot.actuator.v2+json;charset=UTF-8" -d '{"configuredLevel":"DEBUG"}' http://localhost:8080/actuator/loggers/ROOT