【问题标题】:Actuator exposure endpoint not working in spring boot2.5.2执行器暴露端点在 spring boot2.5.2 中不起作用
【发布时间】:2021-07-08 04:32:42
【问题描述】:

当我使用执行器暴露端点时,我使用的是 springboot 2.5.2 版本,它显示了一些错误:

09:48:48.938 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
org.yaml.snakeyaml.scanner.ScannerException: while scanning an alias
 in 'reader', line 18, column 18:
            include: *
                     ^
unexpected character found  (0)
 in 'reader', line 18, column 19:
            include: *
                      ^

bootstrap.yml:

management:
  endpoints:
    web:
      exposure:
        include: *

我在我的 gradle.kt 中使用执行器 gradle 依赖,但为什么我在 yml 文件中声明管理端点时遇到问题?

【问题讨论】:

    标签: spring-boot spring-boot-actuator


    【解决方案1】:

    * 是 YAML 中的特殊字符。它为一个值添加前缀以表明它是一个别名。要将其用作字符串,就像您在此处所做的那样,请将其括在引号中:

    management:
      endpoints:
        web:
          exposure:
            include: '*'
    

    【讨论】:

      猜你喜欢
      • 2019-02-01
      • 2016-12-14
      • 1970-01-01
      • 1970-01-01
      • 2012-04-26
      • 2018-07-08
      • 2019-07-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多