File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 <description >Demo project for browsing Spring Boot logs in Kibana via Elasticsearch</description >
1616
1717 <properties >
18+ <logstash .logback.encoder.version>6.3</logstash .logback.encoder.version>
1819 <java .version>11</java .version>
1920 </properties >
2021
4748 </exclusion >
4849 </exclusions >
4950 </dependency >
51+
52+ <!-- Logstash -->
53+ <dependency >
54+ <groupId >net.logstash.logback</groupId >
55+ <artifactId >logstash-logback-encoder</artifactId >
56+ <version >${logstash.logback.encoder.version} </version >
57+ </dependency >
5058 </dependencies >
5159
5260 <build >
Original file line number Diff line number Diff line change 1-
1+ server.port =8080
2+ spring.application.name =spring-boot-kibana-demo
3+ logstash.host =localhost
4+ logstash.port =5000
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <!DOCTYPE configuration >
3+
4+ <configuration scan =" true" >
5+ <include resource =" org/springframework/boot/logging/logback/base.xml" />
6+
7+ <springProperty scope =" context" name =" app_name" source =" spring.application.name" />
8+ <springProperty scope =" context" name =" app_port" source =" server.port" />
9+ <springProperty scope =" local" name =" logstash_host" source =" logstash.host" />
10+ <springProperty scope =" local" name =" logstash_port" source =" logstash.port" />
11+
12+ <appender name =" logstash" class =" net.logstash.logback.appender.LogstashTcpSocketAppender" >
13+ <param name =" Encoding" value =" UTF-8" />
14+ <remoteHost >${logstash_host}</remoteHost >
15+ <port >${logstash_port}</port >
16+ <encoder class =" net.logstash.logback.encoder.LogstashEncoder" />
17+ </appender >
18+
19+ <root level =" INFO" >
20+ <appender-ref ref =" logstash" />
21+ </root >
22+ </configuration >
You can’t perform that action at this time.
0 commit comments