springboot - Actuator监控&401授权

springboot jar包

pom:

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

配置文件application.yml(application.properties)

1. springboot 1.X : 401不能访问时,加…

访问路径:http://localhost:8089/env

info: # 自定义属性及信息
  head: head
  body: demo
management:
  port: 8089
  endpoints:
    web:
      exposure:
        include: '*'   # 加载所有的端点,默认只加载了info、health
  security:
  	enabled: false

2. springboot 2.X

访问路径:http://localhost:8089/actuator/env

info: # 自定义属性及信息
  code: A100
  body: demo
management:
  server:
    port: 8089
  endpoints:
    web:
      exposure:
        include: '*'   # 加载所有的端点,默认只加载了info、health

猜你喜欢

转载自blog.csdn.net/besto229/article/details/83828505