测试环境:
第一步:动态修改类的日志打印级别
curl "http://118.24.124.163:30033/actuator/loggers/jnpf.attendance.controller.AttenceMachineController" -H "Content-Type: application/json" -d "{\"configuredLevel\":\"error\"}" -X POST
curl "http://127.0.0.1:30033/actuator/loggers/jnpf.attendance.controller.AttenceMachineController" -H "Content-Type: application/json" -d "{\"configuredLevel\":\"debug\"}" -X POST
第二步:回退
curl "http://118.24.124.163:30033/actuator/loggers/jnpf.attendance.controller.AttenceMachineController" -H "Content-Type: application/json" -d "{\"configuredLevel\":\"debug\"}" -X POST
注意:
1、其中jnpf.attendance.controller.AttenceMachineController 为类的全路径,在实际使用的时候,替换实际的类的全路径即可
2、日志调整只能把 debug->info->error,不能把代码中打印的 error->info->debug