引入pom依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
配置文件
#若不配置可能会找到监控端点
management:
security:
enabled: false
#springboot2.x版本上根据需要进行配置,默认是health和info,同时也可以排查不要显示的端点使用
#exclude
endpoints:
web:
exposure:
include: "*"
exclude:info
验证
1.在springboot1.x下使用actuator
在启动日志你可以根据看到如下内容:
在postman中请求一下: