針對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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM