Skip to content

Commit fbf7926

Browse files
committed
使用tinylog记录日志
1 parent 8d265aa commit fbf7926

File tree

4 files changed

+91
-1
lines changed

4 files changed

+91
-1
lines changed

2.x/chapter8-3/pom.xml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<parent>
7+
<groupId>org.springframework.boot</groupId>
8+
<artifactId>spring-boot-starter-parent</artifactId>
9+
<version>2.6.1</version>
10+
<relativePath/> <!-- lookup parent from repository -->
11+
</parent>
12+
13+
<groupId>com.didispace</groupId>
14+
<artifactId>chapter8-3</artifactId>
15+
<version>0.0.1-SNAPSHOT</version>
16+
<description>使用tinylog记录日志</description>
17+
18+
<properties>
19+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
20+
<java.version>1.8</java.version>
21+
</properties>
22+
23+
<dependencies>
24+
<dependency>
25+
<groupId>org.springframework.boot</groupId>
26+
<artifactId>spring-boot-starter-web</artifactId>
27+
<exclusions>
28+
<exclusion>
29+
<groupId>org.springframework.boot</groupId>
30+
<artifactId>spring-boot-starter-logging</artifactId>
31+
</exclusion>
32+
</exclusions>
33+
</dependency>
34+
35+
<dependency>
36+
<groupId>org.springframework.boot</groupId>
37+
<artifactId>spring-boot-starter-test</artifactId>
38+
<scope>test</scope>
39+
</dependency>
40+
41+
<dependency>
42+
<groupId>org.projectlombok</groupId>
43+
<artifactId>lombok</artifactId>
44+
<scope>provided</scope>
45+
</dependency>
46+
</dependencies>
47+
48+
<build>
49+
<plugins>
50+
<plugin>
51+
<groupId>org.springframework.boot</groupId>
52+
<artifactId>spring-boot-maven-plugin</artifactId>
53+
<configuration>
54+
<fork>true</fork>
55+
</configuration>
56+
</plugin>
57+
</plugins>
58+
</build>
59+
60+
</project>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.didispace.chapter83;
2+
3+
import lombok.extern.slf4j.Slf4j;
4+
import org.springframework.boot.SpringApplication;
5+
import org.springframework.boot.autoconfigure.SpringBootApplication;
6+
7+
/**
8+
* @author 程序猿DD
9+
* @version 1.0.0
10+
* @blog https://blog.didispace.com
11+
*/
12+
@Slf4j
13+
@SpringBootApplication
14+
public class Chapter83Application {
15+
16+
public static void main(String[] args) {
17+
SpringApplication.run(Chapter83Application.class, args);
18+
19+
log.error("Hello World");
20+
log.warn("Hello World");
21+
log.info("Hello World");
22+
log.debug("Hello World");
23+
log.trace("Hello World");
24+
}
25+
26+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

2.x/pom.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@
8585
<!-- 日志管理 -->
8686
<module>chapter8-1</module> <!-- 8-1 默认日志管理与Logback配置详解 -->
8787
<module>chapter8-2</module> <!-- 8-2 使用log4j2记录日志 -->
88-
<!-- 8-3 使用tinylog记录日志 -->
88+
<module>chapter8-3</module> <!-- 8-3 使用tinylog记录日志 -->
89+
90+
<!-- 其他内容 -->
91+
<!-- 9-1 如何生成二维码 -->
8992

9093
</modules>
9194
</project>

0 commit comments

Comments
 (0)