Monitoring containerized microservices with a centralized logging architecture.
- Docker Compose v1.22.0
-
For each microservice, rename
example.env
to.env
and supply the needed secrets.docker-compose up -d
-
Then log into Logz.io or your preferred ELK SaaS to view your microservices logs.
Containers run isolated by default. For them to comunicate with one another, you need to place them on the same network. We do this using Docker Compose
- You can pass secrets for a microservice using the
env_file
attribute indocker-compose.yml
- Microservices can communicate using their service names if they are in the same docker
network
- Some values like service hostnames are specified in 2 places: the docker-compose file, and the service-specific .env file (like for the API BaseURL)
- You have to install a plugin for the ELK-service (logz.io) in the fluentd shipper container
- Then you have to configure fluentd plugin with your credentials from the ELK service.