Spring boot framework learning 4-spring boot core (3)

This section mainly:

1: What are the starter poms provided by spring boot for us

2: How to add xml configuration file

3: log related

This article is the fourth spring boot framework learning 4-spring boot core (3)

Disclaimer: This article is original by Kaige Java (www.kaigejava.com), reprinting is prohibited without permission!

One: What are the starter poms that spring boot provides us?

1.1: What are starter poms?

1.2: What are the starter poms provided by spring boot?

Two: how to xml configuration file

Although spring boot advocates zero configuration, that is, no XML configuration. But in the actual project, there are some special requirements, when the xml configuration file must be used, what should we do in this case?

Spring provides the @ImportResource annotation to load xml configuration files.

Let's view the @ImportResource annotation source code:

You can see that it is a string[] array. Multiple are supported. How to configure it?

Three: log processing.

Spring boot supports various log frameworks, and we can modify the default log configuration through configuration.

The default logging framework of spring boot is logback.

Modify the log level in the global configuration file:

dubge level:

error level log:

It can be seen that there are very few error-level logs.

Replenish:

Here is the supplementary log log level:

 

Other articles in this series:

Spring boot framework learns important annotations to master before school (1) - spring's java configuration method

Spring boot framework learns important annotations to master before school (2) - configure spring through java configuration

Spring boot framework learns important annotations before school (3) - reading external resource configuration files through annotations

Spring boot framework learns important annotations before school (4) - reading external resource configuration files through annotations 2

Spring boot framework learning 1 - know spring boot and quick start

Spring boot framework learning 2-spring boot core (1)

Spring boot framework learning 3-spring boot core (2)

Welcome to the public account of Kaige: Kaige Java

Welcome to Kaige's personal website: www.kaigejava.com

Source of this article: http://www.kaigejava.com/article/detail/51

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326642393&siteId=291194637