“Spring Boot 日志设计结构”的版本间的差异

来自姬鸿昌的知识库
跳到导航 跳到搜索
(建立内容为“https://www.bilibili.com/video/BV1iJ411H74S?p=36”的新页面)
 
第1行: 第1行:
 
https://www.bilibili.com/video/BV1iJ411H74S?p=36
 
https://www.bilibili.com/video/BV1iJ411H74S?p=36
 +
 +
=== pom.xml ===
 +
<syntaxhighlight lang="xml">
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<project xmlns="http://maven.apache.org/POM/4.0.0"
 +
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 +
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 +
    <modelVersion>4.0.0</modelVersion>
 +
 +
    <parent>
 +
        <artifactId>spring-boot-starter-parent</artifactId>
 +
        <groupId>org.springframework.boot</groupId>
 +
        <version>2.2.2.RELEASE</version>
 +
    </parent>
 +
 +
    <groupId>io.github.jihch</groupId>
 +
    <artifactId>spring-boot-log</artifactId>
 +
    <version>1.0-SNAPSHOT</version>
 +
 +
    <properties>
 +
        <maven.compiler.source>8</maven.compiler.source>
 +
        <maven.compiler.target>8</maven.compiler.target>
 +
    </properties>
 +
 +
    <dependencies>
 +
        <dependency>
 +
            <groupId>org.springframework.boot</groupId>
 +
            <artifactId>spring-boot-starter-web</artifactId>
 +
        </dependency>
 +
 +
        <dependency>
 +
            <groupId>org.springframework.boot</groupId>
 +
            <artifactId>spring-boot-starter-test</artifactId>
 +
            <scope>test</scope>
 +
            <exclusions>
 +
                <exclusion>
 +
                    <groupId>org.junit.vintage</groupId>
 +
                    <artifactId>junit-vintage-engine</artifactId>
 +
                </exclusion>
 +
            </exclusions>
 +
        </dependency>
 +
    </dependencies>
 +
 +
</project>
 +
</syntaxhighlight>
 +
 +
==== 依赖关系图 ====
 +
{| class="wikitable"
 +
!
 +
! colspan="3" |spring-boot-starter-web
 +
|-
 +
!
 +
! colspan="3" |spring-boot-starter
 +
|-
 +
!
 +
! colspan="3" |spring-boot-starter-logging
 +
|-
 +
!
 +
!jul-to-slf4j
 +
!log4j-to-slf4j
 +
!logback-classic
 +
|-
 +
!日志门面
 +
! colspan="3" |slf4j-api
 +
|-
 +
!日志实现
 +
!JUL
 +
!Log4j
 +
!Logback
 +
|}

2023年2月28日 (二) 09:53的版本

https://www.bilibili.com/video/BV1iJ411H74S?p=36

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <artifactId>spring-boot-starter-parent</artifactId>
        <groupId>org.springframework.boot</groupId>
        <version>2.2.2.RELEASE</version>
    </parent>

    <groupId>io.github.jihch</groupId>
    <artifactId>spring-boot-log</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

</project>

依赖关系图

spring-boot-starter-web
spring-boot-starter
spring-boot-starter-logging
jul-to-slf4j log4j-to-slf4j logback-classic
日志门面 slf4j-api
日志实现 JUL Log4j Logback