The "Spring boot" 8.spring boot log framework uses

Source: Internet
Author: User
Tags log4j

After continuing with the debug debugging of the previous article, the Spring boot log frame usage is gradually eroded.

=============================================================================================

Brief: Spring boot's default log frame Logback

Slf4j--simple Logging facade for Java, which is a unified facade abstraction for a variety of Java log frameworks. There are many Java log frameworks-common to java.util.logging, log4j, logback,commons-logging, and the spring framework using the Jakarta commons logging API (JCL). While SLF4J defines a unified log abstraction interface, the real log implementation is determined at runtime-it provides the binding of various log frameworks.

Logback is a new generation of log frameworks developed by the authors of the log4j framework, which is more efficient and adaptable to many operating environments while naturally supporting SLF4J.

By default, Spring boot uses logback to log logs and output to the console using the info level. When you start running a new spring boot project, you can see the log of the info level in the console.

Like the next 7 parts:

    • ① Time Date: accurate to milliseconds

    • ② log level:error> Warn>info>debug > TRACE priority as in front, info by default, info and higher priority WARN and ERROR are displayed

    • ③ Process ID is PID

    • ④ delimiter:---Identifies the start of the actual log

    • ⑤ thread Name: square brackets (may truncate console output)

    • ⑥logger Name: The class name of the source code is usually used

    • ⑦ Log Content

As can be seen from the above, this spring boot is started on the 8928 process.

In Task Manager, you can see the "if pid,http://www.cnblogs.com/sxdcgaq8080/p/7853081.html is not visible in the Process tab of the task management"

In the case where profile is not set, in general, the console prints out a log that can see this sentence:

The "Spring boot" 8.spring boot log framework uses

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.