本节主要:
1:spring boot 为我们提供的 starter pom 都有哪些
2:怎么添加xml配置文件
3:日志相关
本文是《凯哥陪你学系列-框架学习之spring boot框架学习》中第四篇 spring boot框架学习4-spring boot核心(3)
声明:本文系凯哥Java(www.kaigejava.com)原创,未经允许,禁止转载!
一:spring boot 为我们提供的 starter pom 都有哪些?
1.1:什么是starter poms?
1.2:spring boot 为我们提供的starter pom都有哪些?



二:怎么xml配置文件

spring boot虽然提倡零配置,即无XML配置的。但是在实际项目中,有一些特殊要求,必须使用xml配置文件的时候,这种情况下,我们又该怎么处理呢?
spring 提供了@ImportResource这个注解来加载xml配置文件。
我们查看@ImportResource注解源码:
可以看到是string[]数组的。支持多个的。具体怎么配置呢?


三:日志处理。
spring boot对各种日志框架都做了支持,我们可以通过配置修改默认的日志配置。
spring boot默认的日志框架是logback.
在全局配置文件中修改日志级别:

dubge级别:

error级别日志:

可以看出error级别的日志很少。
补充:
这里补充log日志级别:

本系列其他文章:
spring boot框架学习学前掌握之重要注解(1)-spring的java配置方式
spring boot框架学习学前掌握之重要注解(2)-通过java的配置方式进行配置spring
spring boot框架学习学前掌握之重要注解(3)-通过注解方式读取外部资源配置文件
spring boot框架学习学前掌握之重要注解(4)-通过注解方式读取外部资源配置文件2
spring boot框架学习1-认识spring boot和快速入门
spring boot框架学习2-spring boot核心(1)
spring boot框架学习3-spring boot核心(2)
欢迎关注凯哥公众号:凯哥Java
欢迎访问凯哥个人网站:www.kaigejava.com
本文出处:http://www.kaigejava.com/article/detail/51
spring boot学习系列教程地址:http://kaigejava.com/article/list?cateid=3
网友评论