Setup ELK Stack to capture Spring Boot logs

Image by David Mark from Pixabay

Technologies Used

  1. Java 8/11
  2. Spring Boot 2.x
  3. Elastic Search 6.6.1
  4. LogStash 6.6.1
  5. Kibana 6.6.1

Setup Instructions

  1. Download Elastic Search and unzip it
  2. Start Elastic search with the following command and go to URL http://localhost:9200
$ bin/elasticsearch
input {
file {
path => "/Users/<username>/ELK-Stack/logback/*.log"
codec => "json"
type => "logback"
}
}

output {
if [type]=="logback" {
elasticsearch {
hosts => [ "localhost:9200" ]
index => "logstash"
}
}
}
$ bin/logstash -f logstash-elk.conf
$ bin/kibana
# Logging
logging:
file: /Users/<username>/ELK-Stack/logback/springsecuritydata.log

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Pavan Jadda

Pavan Jadda

Full Stack Developer(Java, Angular and React)