Last active
March 23, 2021 03:56
-
-
Save dictcp/e525b06e6e00f196fa79a260a8d84a7d to your computer and use it in GitHub Desktop.
Revisions
-
dictcp revised this gist
Mar 23, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,7 @@ 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"} -
dictcp revised this gist
Mar 23, 2021 . 1 changed file with 9 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,16 @@ It is a demo on how to leverage on docker logs option to send logs to another server ```bash 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"} ``` -
dictcp created this gist
Mar 23, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ 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) ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ services: web: image: stefanprodan/podinfo ports: - '9898:9898' logging: driver: fluentd options: fluentd-address: "127.0.0.1:24224" depends_on: - "fluentd" fluentd: image: fluent/fluentd:latest ports: - '24224:24224' - '24224:24224/udp' volumes: - ./fluentd.conf:/fluentd/etc/fluentd.conf environment: - FLUENTD_CONF=fluentd.conf This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ <source> @type forward </source> <match *> @type stdout </match>