码迷,mamicode.com
首页 > 编程语言 > 详细

开发框架 springBoot

时间:2018-12-14 10:58:03      阅读:250      评论:0      收藏:0      [点我收藏+]

标签:src   根据   pom   hold   调用   start   访问   div   eal   

1.多个环境的配置文件

技术分享图片

在application.yml 中配置需要调用的配置文件

spring:
  profiles:
    active: dev

运行方式的,先运行application.yml 再根据active指定的配置文件,进行覆盖。

2.运行状态监控Actuator

pom中引入依赖

<!--运行状态监控-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

在application.yml文件中配置

management:
  endpoints:
    web:
      exposure:
        include: "*"
  server:
    port: 10111
    servlet:
      context-path: /
    ssl:
      enabled: false
  endpoint:
    health:
      show-details: always

访问方式:http://localhost:10111/actuator/health

访问结果:

{"status":"UP","details":{"db":{"status":"UP","details":{"database":"MySQL","hello":1}},"diskSpace":{"status":"UP","details":{"total":463330078720,"free":113779286016,"threshold":10485760}}}}

 

开发框架 springBoot

标签:src   根据   pom   hold   调用   start   访问   div   eal   

原文地址:https://www.cnblogs.com/hcfan/p/10118013.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!