美文网首页
2020-05-13

2020-05-13

作者: A_Adorable_Dali | 来源:发表于2020-05-15 18:07 被阅读0次

yml:以数据为中心

yml:语法

@PropertySource:配置指定的配置文件,可以是自定义的配置文件

@ImportSource:

@Bean SpringBoot给容器中添加组件的方式

${}配置文件占位符

${xxx:默认值}配置文件占位符

profile多环境支持

yml文档分块

配置文件加载优先级

互补配置

配置地址访问路径    server.context-path

启动项目时改变默认配置文件的位置(互补配置)    spring.config.location

自动配置类必须要符合条件才生效

查看是否生效

    debug=true

如何让系统中的所有日志都同一到slf4j

1.将系统其他的日志包先排除

2.使用中间替换原来的包

3.导入slf4j的其他实现

spring使用slf4j

1.LoggerFactory.getLogger(getClass())

2.logger.t/d/i/w/e

3.spring默认只显示info及以后

4.设置日志级别可以在applicationContext.properties配置level

相关文章

网友评论

      本文标题:2020-05-13

      本文链接:https://www.haomeiwen.com/subject/omtonhtx.html