Spring Boot Framework Learning 4-spring boot core (3)

Source: Internet
Author: User
Tags log log

This section mainly:

What are the starter Pom 1:spring boot offers for us?

2: How to add an XML configuration file

3: Log Related

This article is "Edith accompany you learn series-Framework learning Spring Boot Framework Learning" in the fourth Spring Boot framework Learning 4-spring boot core (3)

Disclaimer: This article is Edith Java (www.kaigejava.com) original, without permission, no reprint!

A: What are the starter pom that spring boot provides us with?

1.1: What is starter poms?

650) this.width=650; "Src=" http://image.uc.cn//s/wemedia/s/upload/2017/ A934fcdd64d3549b7f87c3c49261e18ex1222x168x40.png "alt=" a934fcdd64d3549b7f87c3c49261e18ex1222x16 "/> What are the starter Pom 1.2:spring boot offers for us?

650) this.width=650; "Src=" http://image.uc.cn//s/wemedia/s/upload/2017/ B9ab0c1507645be831a2a0296c556a3fx1180x435x108.png "alt=" b9ab0c1507645be831a2a0296c556a3fx1180x43 "/>

650) this.width=650; "Src=" http://image.uc.cn//s/wemedia/s/upload/2017/ Eab364d6c57132bc5730b60e6ead62d7x1140x818x231.png "alt=" eab364d6c57132bc5730b60e6ead62d7x1140x81 "/>

650) this.width=650; "Src=" http://image.uc.cn//s/wemedia/s/upload/2017/ Cade2675c1ad4dddaec3de533ecd76aex1160x627x179.png "alt=" cade2675c1ad4dddaec3de533ecd76aex1160x62 "/> Two: How XML configuration file

Spring boot, while advocating 0 configuration, is no XML configuration. However, in the actual project, there are some special requirements, we must use the XML configuration file, in this case, how do we deal with it?

Spring provides @importresource this annotation to load the XML configuration file.

We view @importresource annotated source code:

650) this.width=650; "Src=" http://image.uc.cn//s/wemedia/s/upload/2017/ 236a7aa125a4c2311db21d4ddc36d6e1x797x512x17.png "alt=" 236a7aa125a4c2311db21d4ddc36d6e1x797x512 "/> You can see the string[] array. Support for multiple. How to configure it exactly?

650) this.width=650; "Src=" http://image.uc.cn//s/wemedia/s/upload/2017/ Ae3dad0e076595de6636d441865cc633x1132x89x54.png "alt=" ae3dad0e076595de6636d441865cc633x1132x89 "/>

Three: Log processing.

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

The default log frame for spring boot is logback.

To modify the log level in the global configuration file:

650) this.width=650; "Src=" http://image.uc.cn//s/wemedia/s/upload/2017/ 1eb44c574ca9b23129e0aacbbcfba188x642x246x9.png "alt=" 1eb44c574ca9b23129e0aacbbcfba188x642x246 "/>

DUBGE level:

650) this.width=650; "Src=" http://image.uc.cn//s/wemedia/s/upload/2017/ 09202a543e3260d119b56679f7d3b5dfx1227x544x31.png "alt=" 09202a543e3260d119b56679f7d3b5dfx1227x54 "/>

Error level log:

650) this.width=650; "Src=" http://image.uc.cn//s/wemedia/s/upload/2017/ 4cf0eebe8f0fe67d4cbe910bebced020x1574x407x20.png "alt=" 4cf0eebe8f0fe67d4cbe910bebced020x1574x40 "/>

You can see that there are very few log error levels.

Add:

This adds the log log level:


650) this.width=650; "Src=" http://image.uc.cn//s/wemedia/s/upload/2017/ 99df8198ad243f1ba724dee39510e547x1370x366x23.png "alt=" 99df8198ad243f1ba724dee39510e547x1370x36 "/>

Other articles in this series:

Spring Boot Framework Learn the important annotations of preschool mastery (1)-spring Java configuration method

Spring Boot Framework Learn important annotations for preschool Mastery (2)-Configure with Java configuration spring

Spring Boot Framework Learn important notes for preschool mastery (3)-read external resource profiles by annotation

Spring Boot Framework Learn important notes for preschool mastery (4)-read external resource profiles by annotation 2

Spring Boot Framework Learning 1-Understanding Spring boot and QuickStart

Spring Boot Framework Learning 2-spring boot core (1)

Spring Boot Framework Learning 3-spring boot core (2)

Welcome to the Gothic public: Edith Java

Welcome to visit Edith Personal website: www.kaigejava.com

The source of this article: HTTP://WWW.KAIGEJAVA.COM/ARTICLE/DETAIL/51


This article from the "Edith Java" blog, reproduced please contact the author!

Spring Boot Framework Learning 4-spring boot core (3)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.