Summary
In this chapter, we learned why logging and shipping the log to a central location is important. We then showed you how to set up an ELK Stack locally on our computer that can serve as a hub for logs. We generated a special version of this stack, including Filebeat, which can run on a Mac or Windows computer using the workaround of redirecting the standard log output to a file whose parent folder is mapped to a Docker volume. This volume is then mounted to Filebeat, which, in turn, forwards the logs to ElasticSearch. On a production or production-like system, the applications run on Linux servers or VMs and thus Filebeat can directly collect the logs from the default location, where Docker directs the logs at /var/lib/docker/containers
.
We also learned how to use Prometheus and Grafana to scrape, collect, and display the metrics of your applications centrally on a dashboard. We used a simple Kotlin application that exposed a counter to demonstrate this.
Lastly, we briefly...