我正在从我的应用程序logstash成功发送日志,我从本教程开始qazxsw poi然后轻松地将我的代码实现到我自己的应用程序中。
我的问题是我没有在我的应用程序中的任何地方提到过filebeats,它是如何被使用的?
一切都在工作,但很想知道filebeats的来源,是通过pom文件中的logstash依赖吗?
的logback-spring.xml
http://www.andrew-programming.com/2018/09/18/integrate-springboot-application-with-elk-and-filebeat/
application.properties
<!DOCTYPE configuration>
<configuration>
<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>localhost:4560</destination>
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">
</encoder>
</appender>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<root level="INFO">
<appender-ref ref="LOGSTASH" />
<!--<appender-ref ref="CONSOLE" />-->
</root>
</configuration>
pom依赖
logging.file=/tmp/filebeatDemoApp.log
logstash.conf
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>5.1</version>
</dependency>