Log has log facade and log implementation.

Log facade includes JCL, SLF4J, and Jboss-Logging

Logging implementation contains: log4j logback/log4j2 / Java. Util. Logging (jul)

Spring uses JCL: Java Common Logging by default

Springboot uses LogBack and SLf4J by default

Hibernate uses Jboss-Logging by default

The Springboot-starter dependency automatically references Springboot-starter-logging

Springboot – starter – logging is specially used for processing the log, it will automatically introduction: log4j/jul/logback/JCL slf4j jar

Jcl-over-slf4j and log4j-over-slf4j are intermediate packages, and SlF4J is used by Springboot

When SpringBoot introduces other frameworks, dependencies are required to exclude their own logging dependencies. For example, Spring excludes the common-logging dependency.

Toggle options for other logging frameworks:

spring-boot-starter-log4j2

spring-boot-starter-logging

Application.properties Modifies the default springBoot configuration:

logging.level

Logging.path (if not specified, springboot.log will be generated under the current project)

logging.file=G:\springboot.log

Logging. path=/spring/log (create the spring and log folders locally. If logging.file is not specified, spring. Log will be generated in the log directory)

Logging.pattern. Console Console output format

Logging.pattern. file File output format

Docs. Spring. IO/spring – the boot…

Blog.csdn.net/weixin_4366…

Docs. Spring. IO/spring – the boot…

Logging System Customization

Logback

logback-spring.xml, logback-spring.groovy, logback.xml or logback.groovy

Log4j2

log4j2-spring.xml or log4j2.xml

JDK (Java Util Logging)

logging.properties