Skip to content

Commit

Permalink
优化LOGBACK文件,logstash参数读取spring配置文件
Browse files Browse the repository at this point in the history
  • Loading branch information
LeiGaoRobot committed Nov 4, 2021
1 parent 10c3e90 commit c5f5128
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion admin/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<springProperty scope="context" name="APP_NAME" source="spring.application.name"/>
<!--日志文件保存路径-->
<springProperty scope="context" name="LOG_FILE_PATH" source="logging.file.path"/>
<springProperty scope="context" name="LOGSTASH_SERVER" source="lili.data.logstash.server"/>
<contextName>${APP_NAME}</contextName>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
Expand All @@ -22,7 +23,7 @@
<!--输出到elk的LOGSTASH-->
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
<destination>127.0.0.1:4560</destination>
<destination>${LOGSTASH_SERVER}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
<providers>
<timestamp>
Expand Down
3 changes: 2 additions & 1 deletion buyer-api/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<springProperty scope="context" name="APP_NAME" source="spring.application.name"/>
<!--日志文件保存路径-->
<springProperty scope="context" name="LOG_FILE_PATH" source="logging.file.path"/>
<springProperty scope="context" name="LOGSTASH_SERVER" source="lili.data.logstash.server"/>
<contextName>${APP_NAME}</contextName>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
Expand All @@ -22,7 +23,7 @@
<!--输出到elk的LOGSTASH-->
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
<destination>127.0.0.1:4560</destination>
<destination>${LOGSTASH_SERVER}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
<providers>
<timestamp>
Expand Down
3 changes: 2 additions & 1 deletion common-api/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<springProperty scope="context" name="APP_NAME" source="spring.application.name"/>
<!--日志文件保存路径-->
<springProperty scope="context" name="LOG_FILE_PATH" source="logging.file.path"/>
<springProperty scope="context" name="LOGSTASH_SERVER" source="lili.data.logstash.server"/>
<contextName>${APP_NAME}</contextName>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
Expand All @@ -22,7 +23,7 @@
<!--输出到elk的LOGSTASH-->
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
<destination>127.0.0.1:4560</destination>
<destination>${LOGSTASH_SERVER}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
<providers>
<timestamp>
Expand Down
3 changes: 2 additions & 1 deletion consumer/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<springProperty scope="context" name="APP_NAME" source="spring.application.name"/>
<!--日志文件保存路径-->
<springProperty scope="context" name="LOG_FILE_PATH" source="logging.file.path"/>
<springProperty scope="context" name="LOGSTASH_SERVER" source="lili.data.logstash.server"/>
<contextName>${APP_NAME}</contextName>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
Expand All @@ -22,7 +23,7 @@
<!--输出到elk的LOGSTASH-->
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
<destination>127.0.0.1:4560</destination>
<destination>${LOGSTASH_SERVER}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
<providers>
<timestamp>
Expand Down
3 changes: 2 additions & 1 deletion manager-api/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<springProperty scope="context" name="APP_NAME" source="spring.application.name"/>
<!--日志文件保存路径-->
<springProperty scope="context" name="LOG_FILE_PATH" source="logging.file.path"/>
<springProperty scope="context" name="LOGSTASH_SERVER" source="lili.data.logstash.server"/>
<contextName>${APP_NAME}</contextName>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
Expand All @@ -22,7 +23,7 @@
<!--输出到elk的LOGSTASH-->
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
<destination>127.0.0.1:4560</destination>
<destination>${LOGSTASH_SERVER}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
<providers>
<timestamp>
Expand Down
3 changes: 2 additions & 1 deletion seller-api/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<springProperty scope="context" name="APP_NAME" source="spring.application.name"/>
<!--日志文件保存路径-->
<springProperty scope="context" name="LOG_FILE_PATH" source="logging.file.path"/>
<springProperty scope="context" name="LOGSTASH_SERVER" source="lili.data.logstash.server"/>
<contextName>${APP_NAME}</contextName>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
Expand All @@ -22,7 +23,7 @@
<!--输出到elk的LOGSTASH-->
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<!-- 配置elk日志收集 配饰的是 LOGSTASH 的地址-->
<destination>127.0.0.1:4560</destination>
<destination>${LOGSTASH_SERVER}</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
<providers>
<timestamp>
Expand Down

0 comments on commit c5f5128

Please sign in to comment.