Streaming Gin logs to the ELK platform
Another beneficial aspect to keep an eye on while deploying a Gin web application in production is logs. Logs can help you find the root cause of bad application performance or crashes.
However, logs can be verbose and spammy – that's why you'll need a centralized platform to be able to apply filters and keep an eye on important events. That's where a solution such as Elasticsearch, Logstash, and Kibana (ELK) is needed. The following schema illustrates how such a solution can be implemented:
Gin application logs will be shipped to Logstash using the Docker GELF driver (https://docs.docker.com/config/containers/logging/gelf/). From there, Logstash will process the incoming logs and store them in Elasticsearch. Finally, the logs can be visualized in Kibana through interactive dashboards.
Deploying the ELK stack with Docker
By now, you should...