使用Spring Boot的Actuator,查看监控信息,需要在pom.xml文件中添加
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
另外在application.properties文件中配置
management.port=9001
management.security.enabled=false
访问localhost:9001/beans即可看到json信息