針對Fluent-Bit採集容器日誌的補充

hello,之前我寫過《一套標準的ASP.NET Core容器化應用日誌收集分析方案》,在公司團隊、微信公衆號、Github上反映良好。

其中配置Fluent-bit使用Forward協議收集容器日誌,需要在Docker-Compose App配置Loging Driver=Fluentd,

實踐中,存在一個小遺憾:
應用了Logging Driver= Fluentd的容器,不再能直觀看到容器日誌。

作爲一個小有技術潔癖的碼農,勢必要深究一下原因。


羣裏某大佬,給到官方資料:

Note
When using Docker Engine 19.03 or older, the docker logs command is only functional for the local, json-file and journald logging drivers. Docker 20.10 and up introduces “dual logging”, which uses a local buffer that allows you to use the docker logs command for any logging driver. Refer to reading logs when using remote logging drivers for details.

大意:19.03及之前版本的Docker,docker log命令僅僅作用在localjson-filejournald類型的logging Driver。

但是Docker 20.10版本引入了dual logging(提供本地緩存), 這樣可以在任意logging Driver上使用docker log指令。

Todo

So, 將Docker升級到20.10+版本...... 解決這個小遺憾。

插曲:
選擇Docker 20+版本時,請輸入上圖的:後面字符串所指示的版本:
yum install docker-ce-20.10.2 docker-ce-cli-20.10.2 containerd.io

That's All, 以上是對《一套標準的ASP.NET Core容器化應用日誌收集分析方案》的補充,應該對同學們有所幫助!。。

Ref

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章