【发布时间】:2018-04-04 23:37:13
【问题描述】:
在我的 application.properties 上,我有 endpoints.enabled=false 和 endpoints.health.enabled=false 但 /health 端点仍然没有被抑制。
【问题讨论】:
标签: spring spring-boot spring-boot-actuator
在我的 application.properties 上,我有 endpoints.enabled=false 和 endpoints.health.enabled=false 但 /health 端点仍然没有被抑制。
【问题讨论】:
标签: spring spring-boot spring-boot-actuator
也许您缺少第一级属性。 应该像这样配置属性,以禁用所有端点
management.endpoints.enabled-by-default= false
如果您只想禁用健康端点而不是使用此属性:
management.endpoint.health.enabled=false
【讨论】:
我认为这里的问题可能是正在使用的 Sprint Boot 版本。 1.5.x 与 2.0.x 有不同的属性。
Spring Boot 2.0.x
management.endpoints.enabled-by-default=false
management.endpoint.health.enabled=false
management.endpoint.info.enabled=true
Spring Boot 1.5.x
endpoints.enabled=false
endpoint.health.enabled=false
endpoint.info.enabled=true
另请注意,在启用端点时,您使用复数(“endpoints”),但在启用特定端点时,您使用单例(“endpoint”)。
【讨论】: