actuator是SpringBoot的一个附加功能,可帮助你在应用程序生产环境时监视和管理应用程序。可以使用HTTP的各种请求来监管,审计,收集应用的运行情况。
引入actuator依赖 :
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
启用所有的endpoints:
在起作用的配置文件中添加配置(默认为:application.properties),如下:
management.endpoints.web.exposure.include=*
查看起效的endpoints:
http://localhost:8080/actuator
查看所有的SpringBean:
如果不出意外的话,使用下面的地址就可以进行查看:
http://localhost:8080/actuator/beans
查找某个特定的SpringBean:
在http://localhost:8080/actuator/beans页面上使用CTRL+F查找即可。
本文介绍SpringBoot的Actuator模块,它提供了一种在生产环境中监控和管理应用程序的方法。通过HTTP请求,可以审计、监管和收集应用程序的运行状态。文章详细说明了如何引入依赖,配置并启用所有endpoints,以及如何查看SpringBean。
5667

被折叠的 条评论
为什么被折叠?



