当前位置: 首页 > 知识库问答 >
问题:

无法获得spring-boot/Health指示器以显示全部内容

郑和泰
2023-03-14
endpoints.health.sensitive=true
management.security.enabled=true
2016-11-06 10:48:18,936 [XNIO-3 task-1]DEBUG o.s.c.e.PropertySourcesPropertyResolver - Found key 'endpoints.health.sensitive' in [applicationConfig: [classpath:/application.properties]] with type [String] and value 'true'
2016-11-06 10:48:19,109 [XNIO-3 task-1]DEBUG o.s.s.w.h.writers.HstsHeaderWriter - Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@4542ffee
2016-11-06 10:48:19,109 [XNIO-3 task-1]DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - SecurityContext 'org.springframework.security.core.context.SecurityContextImpl@760f603a: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@760f603a: Principal: org.springframework.security.ldap.userdetails.LdapUserDetailsImpl@375540cb: ......; Enabled: true; AccountNonExpired: true; CredentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ......; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@b364: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: null; Granted Authorities: .....' stored to HttpSession: 'io.undertow.servlet.spec.HttpSessionImpl@768a4e99
2016-11-06 10:48:19,148 [XNIO-3 task-1]DEBUG o.s.w.s.m.m.a.RequestResponseBodyMethodProcessor - Written [UP {}] as "application/json" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@eae8a50]

根据我所读到的,应该会显示数据库状态。

我错过了什么?

共有1个答案

柏高洁
2023-03-14

Spring Boot Actuator/Healthendpoint可能重复,不显示数据库或文件系统信息

我认为您需要在默认情况下启用数据库健康检查

management.health.db.enabled=true # Enable database health check.
management.health.defaults.enabled=true # Enable default health indicators.
management.health.diskspace.enabled=true # Enable disk space health check.

Spring Boot还为各种后端实现提供了自动配置的健康指示器

 类似资料:
  • 我将greeting.html文件放在src/main/webapp/web-inf/templates和src/main/resources/templates中,我试图在application.properties中指定 我尝试了这些StackOverflow中提出的解决方案:“Spring Boot不提供静态内容”和“Spring Boot不启动静态web内容”,但没有任何改变... 最后是

  • 我试图创建一个简单的Spring Boot应用程序 我创建了Spring Boot应用程序类、配置类、控制器类和index.html。 我添加了Thymeleaf依赖项,并将html页面放在resources文件夹下(\src\main\resources\templates\index.html) 但当我运行应用程序时,它会给出一个错误 Thymeleaf的WebConfiguration in

  • 我相信几乎所有的教程都在互联网上,读了很多这样的答案,但我仍然卡住了。

  • 问题内容: 我正在尝试使用Pinterest JavaScript SDK来获取项目的一些固定数据。我在创建的Pinterest服务中有一个方法,该方法在HomeController中被调用。我尝试将响应放入承诺中,以便将其放在HomeController上并在视图中显示。但是,在我看来,$ scope.pins是未定义的。为什么呢?似乎诺言正在奏效。还在学习承诺。 Pinterest服务 家庭控

  • 问题内容: 我想了解当CSS是CSS元素的DOM子元素(因此block元素是inline元素的子元素)时会发生什么情况。 CSS 2.1规范的“ 匿名块框”部分描述了这种情况:该示例包括以下规则… …以及随附的文字说… BODY元素包含一个匿名文本块(C1),然后是一个块级元素,然后是另一个匿名文本块(C2)。结果框将是围绕BODY的匿名阻止框,其中包含C1周围的匿名阻止框,P阻止框和C2周围包含

  • 我无法显示抽屉指示灯。目前,我要么什么都没有,要么” 我使用: v4。小装置。抽屉布局 v7。应用程序。ActionBarDrawerToggle 但是android。应用程序。ActionBar(不支持7) 以下是代码片段: