Commit bd88b647 authored by duanledexianxianxian's avatar duanledexianxianxian 😁

🍱 添加ELK相关配置

parent 6e40c41b
Pipeline #117 failed
...@@ -44,5 +44,11 @@ ...@@ -44,5 +44,11 @@
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId> <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency> </dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>${logstash.logback.encoder.version}</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -3,7 +3,7 @@ server: ...@@ -3,7 +3,7 @@ server:
port: 9204 port: 9204
hello: hello:
name: "order application default name version 2" name: "order application default name version 2"
spring: spring:
application: application:
......
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<springProperty scope="context" name="springAppName"
source="spring.application.name" />
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>113.105.144.9:9101</destination>
<!-- 日志输出编码 -->
<encoder charset="UTF-8"
class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
<providers>
<timestamp>
<timeZone>UTC</timeZone>
</timestamp>
<pattern>
<pattern>
{
"logLevel": "%level",
"serviceName": "${springAppName:-}",
"pid": "${PID:-}",
"thread": "%thread",
"class": "%logger{40}",
"rest": "%message"
}
</pattern>
</pattern>
</providers>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="LOGSTASH"/>
<appender-ref ref="CONSOLE"/>
</root>
</configuration>
\ No newline at end of file
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
<artifactId>spring-cloud-hello-world</artifactId> <artifactId>spring-cloud-hello-world</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<properties>
<logstash.logback.encoder.version>6.2</logstash.logback.encoder.version>
</properties>
<modules> <modules>
<module>service-discovery</module> <module>service-discovery</module>
<module>hello-producer</module> <module>hello-producer</module>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment