It is a demo on how to leverage on docker logs option to send logs to another server
docker-compose up -d
docker-compose restart web
docker-compose logs
## you will see the stdout from podinfo and go to fluentd stdout (due to the fluentd config), like
## fluentd_1 | 2021-03-23 03:51:58.000000000 +0000 7a3c12568bff: {"log":"Error to open config file, stat config.yaml: no such file or directory","container_id":"7a3c12568bff77f17a3909d63074401328af851e5d763a2b75b1e7e273c6ef33","container_name":"/test_web_1","source":"stdout"}
## fluentd_1 | 2021-03-23 03:51:58.000000000 +0000 7a3c12568bff: {"source":"stderr","log":"{\"level\":\"info\",\"ts\":\"2021-03-23T03:51:58.480Z\",\"caller\":\"podinfo/main.go:150\",\"msg\":\"Starting podinfo\",\"version\":\"5.2.0\",\"revision\":\"\",\"port\":\"9898\"}","container_id":"7a3c12568bff77f17a3909d63074401328af851e5d763a2b75b1e7e273c6ef33","container_name":"/test_web_1"}
## web_1 | Error to open config file, stat config.yaml: no such file or directory
## web_1 | {"level":"info","ts":"2021-03-23T03:51:43.991Z","caller":"podinfo/main.go:150","msg":"Starting podinfo","version":"5.2.0","revision":"","port":"9898"}
## web_1 | {"level":"info","ts":"2021-03-23T03:51:54.920Z","caller":"api/server.go:209","msg":"Shutting down HTTP/HTTPS server","timeout":5}
## web_1 | Error to open config file, stat config.yaml: no such file or directory
## web_1 | {"level":"info","ts":"2021-03-23T03:51:58.480Z","caller":"podinfo/main.go:150","msg":"Starting podinfo","version":"5.2.0","revision":"","port":"9898"}