mirror of
https://gitee.com/yudaocode/SpringBoot-Labs.git
synced 2026-09-09 16:57:32 +08:00
增加 log 相关的示例
This commit is contained in:
23
lab-38/lab-38-elk-demo/pom.xml
Normal file
23
lab-38/lab-38-elk-demo/pom.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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">
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.2.2.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>lab-38-elk-demo</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!-- 实现对 Spring MVC 的自动化配置 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,13 @@
|
||||
package cn.iocoder.springboot.lab38.elkdemo;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
spring:
|
||||
application:
|
||||
name: demo-application # 应用名
|
||||
|
||||
logging:
|
||||
# 日志文件配置
|
||||
file:
|
||||
name: /Users/yunai/logs/${spring.application.name}.log # 日志文件名。
|
||||
8
lab-38/lab-38-elk-demo/target/classes/application.yaml
Normal file
8
lab-38/lab-38-elk-demo/target/classes/application.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
spring:
|
||||
application:
|
||||
name: demo-application # 应用名
|
||||
|
||||
logging:
|
||||
# 日志文件配置
|
||||
file:
|
||||
name: /Users/yunai/logs/${spring.application.name}.log # 日志文件名。
|
||||
17
lab-38/pom.xml
Normal file
17
lab-38/pom.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?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">
|
||||
<parent>
|
||||
<artifactId>labs-parent</artifactId>
|
||||
<groupId>cn.iocoder.springboot.labs</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>lab-38</artifactId>
|
||||
<modules>
|
||||
<module>lab-38-elk-demo</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
Reference in New Issue
Block a user