问题描述
我可以访问http://localhost:8081/health
,/status
,/env
,/metrics
,/shutdown
等端点,但不能 /actuator
或/loginfo
端点.
I am able to access endpoints like http://localhost:8081/health
, /status
, /env
, /metrics
, /shutdown
but not /actuator
or /loginfo
endpoints.
获得例外.
{"timestamp":1455929182552,"status":404,"error":"Not Found","message":"No message available","path":"/actuator"}
如何访问 http://localhost:8081/actuator 端点?
推荐答案
从Spring Boot版本2.0.1开始,使用下面的属性将起作用
As of spring boot version 2.0.1 using below property would work
management.endpoints.web.exposure.include=<comma separated endpoints you wish to expose>
如果您不关心安全性,则可以使用*
通配符在网络上公开所有执行器端点.
You can use *
wildcard to expose all actuator endpoints over the web if security isn't your concern.
端点似乎也已从以前的版本中移出.对于前.如果您想使用bean,现在将具有/actuator/beans
端点.
Also endpoints seems to have moved from previous versions. For ex. if you wish to use beans, you would now have /actuator/beans
endpoint.
只需确保查看此类端点的启动日志即可.
Just to be sure look at startup logs for such endpoints.
有关端点的更多信息,请参见这里
More on endpoints can be found here
这篇关于无法访问Spring Boot执行器"/actuator".终点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!