在运行时禁用更改Spring Boot日志记录级别

时间:2018-11-06 04:54:15

标签: spring spring-boot spring-boot-actuator

我们知道,可以使用以下请求在运行时更改日志记录级别。

curl -X "POST" "http://localhost:8080/loggers/de.springbootbuch" \
     -H "Content-Type: application/json; charset=utf-8" \
     -d $'{
  "configuredLevel": "WARN"
}'

我想禁用在运行时更改日志记录级别。

任何帮助将不胜感激。

2 个答案:

答案 0 :(得分:0)

正如@Medium在评论中所说,我必须禁用记录器端点。

management.endpoint.loggers.enabled=false

参考:production-ready-endpoints

答案 1 :(得分:-2)

设置

management.security.enabled = false

OR

 endpoints.loggers.sensitive = false

禁用安全性。

参考https://blog.codeleak.pl/2017/03/spring-boot-configure-log-level-in.html

相关问题