【问题标题】:Disable changing spring boot logging level on runtime在运行时禁用更改 Spring Boot 日志记录级别
【发布时间】:2018-11-06 04:54:14
【问题描述】:

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

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

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

任何帮助将不胜感激。

【问题讨论】:

  • 只需禁用记录器端点。

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


【解决方案1】:

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

management.endpoint.loggers.enabled=false

参考:production-ready-endpoints

【讨论】:

    【解决方案2】:

    设置任一

    management.security.enabled = false
    

     endpoints.loggers.sensitive = false
    

    禁用安全性。

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

    【讨论】:

      猜你喜欢
      • 2019-04-09
      • 1970-01-01
      • 1970-01-01
      • 2015-01-17
      • 1970-01-01
      • 1970-01-01
      • 2019-08-30
      • 1970-01-01
      • 2014-09-01
      相关资源
      最近更新 更多