Skip to content

Commit 28922db

Browse files
author
YunaiV
committed
增加 log 相关的示例
1 parent 0af7453 commit 28922db

File tree

6 files changed

+70
-0
lines changed

6 files changed

+70
-0
lines changed

lab-38/lab-38-elk-demo/pom.xml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<groupId>org.springframework.boot</groupId>
7+
<artifactId>spring-boot-starter-parent</artifactId>
8+
<version>2.2.2.RELEASE</version>
9+
<relativePath/> <!-- lookup parent from repository -->
10+
</parent>
11+
<modelVersion>4.0.0</modelVersion>
12+
13+
<artifactId>lab-38-elk-demo</artifactId>
14+
15+
<dependencies>
16+
<!-- 实现对 Spring MVC 的自动化配置 -->
17+
<dependency>
18+
<groupId>org.springframework.boot</groupId>
19+
<artifactId>spring-boot-starter-web</artifactId>
20+
</dependency>
21+
</dependencies>
22+
23+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package cn.iocoder.springboot.lab38.elkdemo;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
6+
@SpringBootApplication
7+
public class Application {
8+
9+
public static void main(String[] args) {
10+
SpringApplication.run(Application.class, args);
11+
}
12+
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
spring:
2+
application:
3+
name: demo-application # 应用名
4+
5+
logging:
6+
# 日志文件配置
7+
file:
8+
name: /Users/yunai/logs/${spring.application.name}.log # 日志文件名。
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
spring:
2+
application:
3+
name: demo-application # 应用名
4+
5+
logging:
6+
# 日志文件配置
7+
file:
8+
name: /Users/yunai/logs/${spring.application.name}.log # 日志文件名。

lab-38/pom.xml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>labs-parent</artifactId>
7+
<groupId>cn.iocoder.springboot.labs</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>lab-38</artifactId>
13+
<modules>
14+
<module>lab-38-elk-demo</module>
15+
</modules>
16+
17+
</project>

pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<module>lab-35</module>
4747
<module>lab-36</module>
4848
<module>lab-37</module>
49+
<module>lab-38</module>
4950
</modules>
5051

5152

0 commit comments

Comments
 (0)