---
title: "Spring Boot Actuator"
author: "qingfeng825"
date: "2018-07-24T13:46:01Z"
tags: []
categories: ["开源软件"]
slug: "spring-boot-actuator"
draft: false
lastmod: "2018-07-24T13:52:20Z"
id: 2427403
url: "https://qingfeng825.iteye.com/blog/2427403"
---

Spring Boot : 2.0.3

POM文件中加入

```
  <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
<dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
          </dependency>
```

 

启动Tomcat时，在 console 里增加了以下的日志

1.访问：http://localhost:8080/actuator/health,返回

{  
"status": "UP"  
}

2\. 访问： http://localhost:8080/actuator/info,返回

{}

通过SpringBoot 官网得知， 对于Web 下查看，只有health 和 info 两个endpoint 是enable 的

https://docs.spring.io/spring-boot/docs/2.0.3.RELEASE/reference/htmlsingle/#production-ready-enabling

 

在src\\main\\resources\\application.properties 中增加下面的内容，打开所有的 endpoint, 并重新启动，在日志里可以看到下面内容

management.endpoints.web.exposure.include=*

可以已经exposing 14 endpoints