1.依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
2.配置
#设置健康监控
#开启什么
management.endpoints.web.exposure.include=*
#关闭什么
management.endpoints.web.exposure.exclude=env
启动项目
测试访问:
http://localhost:8080/actuator/metrics/jvm.memory.used
具体查看有那些可访问的接口:
查看启动日志:
配置打印信息级别:(针对2.1版本之后)
logging.level.web = trace
参考地址: