In your projects, you can feed your logs to ElasticSearch (and also Kibana) with your logback.xml file.
Let’s add logstash dependency to our pom.xml file:
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>6.3</version>
</dependency>
Update your logback.xml file with the appender named “STASH”:
You can create a Logstash config file like below (pay attention to the destination for your localhost in logback.xml file and the tcp connection host and port below):
Happy Coding!