Skip to content

Commit

Permalink
使用tinylog记录日志
Browse files Browse the repository at this point in the history
  • Loading branch information
dyc87112 committed Feb 11, 2022
1 parent 8d265aa commit fbf7926
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 1 deletion.
60 changes: 60 additions & 0 deletions 2.x/chapter8-3/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?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>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<groupId>com.didispace</groupId>
<artifactId>chapter8-3</artifactId>
<version>0.0.1-SNAPSHOT</version>
<description>使用tinylog记录日志</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>

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

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.didispace.chapter83;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
* @author 程序猿DD
* @version 1.0.0
* @blog https://blog.didispace.com
*/
@Slf4j
@SpringBootApplication
public class Chapter83Application {

public static void main(String[] args) {
SpringApplication.run(Chapter83Application.class, args);

log.error("Hello World");
log.warn("Hello World");
log.info("Hello World");
log.debug("Hello World");
log.trace("Hello World");
}

}
1 change: 1 addition & 0 deletions 2.x/chapter8-3/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

5 changes: 4 additions & 1 deletion 2.x/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@
<!-- 日志管理 -->
<module>chapter8-1</module> <!-- 8-1 默认日志管理与Logback配置详解 -->
<module>chapter8-2</module> <!-- 8-2 使用log4j2记录日志 -->
<!-- 8-3 使用tinylog记录日志 -->
<module>chapter8-3</module> <!-- 8-3 使用tinylog记录日志 -->

<!-- 其他内容 -->
<!-- 9-1 如何生成二维码 -->

</modules>
</project>

0 comments on commit fbf7926

Please sign in to comment.