Logspout 發送舊的 docker 日誌

Logspout 發送舊的 docker 日誌

您好,我有 logspout 用於將日誌從 docker 容器發送到 papertrail,但現在我發現重新啟動 docker 容器後,logspout 還會發送所有舊日誌

Oct 06 15:37:09 gridhub r-Default-gridhub-1-96bd5cd9:  * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) 
Oct 06 15:37:09 gridhub r-Default-gridhub-1-96bd5cd9: 172.30.100.112 - - [03/Oct/2017 12:39:05] "GET / HTTP/1.1" 200 - 
Oct 06 15:37:09 gridhub r-Default-gridhub-1-96bd5cd9: 172.30.100.112 - - [03/Oct/2017 12:39:06] "GET /static/favicon.ico HTTP/1.1" 200 - 
Oct 06 15:37:09 gridhub r-Default-gridhub-1-96bd5cd9: 172.30.100.112 - - [03/Oct/2017 12:39:06] "GET /static/issue_count_low.png HTTP/1.1" 200 - 
Oct 06 15:37:09 gridhub r-Default-gridhub-1-96bd5cd9: 172.30.100.112 - - [03/Oct/2017 12:39:06] "GET /static/issue_count_high.png HTTP/1.1" 200 - 
Oct 06 15:37:09 gridhub r-Default-gridhub-1-96bd5cd9:  * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) 
Oct 11 10:21:38 gridhub r-Default-gridhub-1-96bd5cd9:  * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) 
Oct 11 10:21:38 gridhub r-Default-gridhub-1-96bd5cd9: 172.30.100.112 - - [03/Oct/2017 12:39:05] "GET / HTTP/1.1" 200 - 
Oct 11 10:21:38 gridhub r-Default-gridhub-1-96bd5cd9: 172.30.100.112 - - [03/Oct/2017 12:39:06] "GET /static/favicon.ico HTTP/1.1" 200 - 
Oct 11 10:21:38 gridhub r-Default-gridhub-1-96bd5cd9: 172.30.100.112 - - [03/Oct/2017 12:39:06] "GET /static/issue_count_low.png HTTP/1.1" 200 - 
Oct 11 10:21:38 gridhub r-Default-gridhub-1-96bd5cd9: 172.30.100.112 - - [03/Oct/2017 12:39:06] "GET /static/issue_count_high.png HTTP/1.1" 200 - 
Oct 11 10:21:38 gridhub r-Default-gridhub-1-96bd5cd9:  * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) 
Oct 11 10:21:38 gridhub r-Default-gridhub-1-96bd5cd9:  * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit) 

在 docker 容器中只有:

10/3/2017 2:38:50 PM * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
10/3/2017 2:39:05 PM172.30.100.112 - - [03/Oct/2017 12:39:05] "GET / HTTP/1.1" 200 -
10/3/2017 2:39:06 PM172.30.100.112 - - [03/Oct/2017 12:39:06] "GET /static/favicon.ico HTTP/1.1" 200 -
10/3/2017 2:39:06 PM172.30.100.112 - - [03/Oct/2017 12:39:06] "GET /static/issue_count_low.png HTTP/1.1" 200 -
10/3/2017 2:39:06 PM172.30.100.112 - - [03/Oct/2017 12:39:06] "GET /static/issue_count_high.png HTTP/1.1" 200 -
10/6/2017 3:37:09 PM * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
10/11/2017 10:21:38 AM * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)

你知道如何在重新啟動後僅發送實際的最後日誌嗎?

答案1

BACKLOG=false好吧,最後我透過添加到 logspout 容器環境中修復了它。
https://github.com/gliderlabs/logspout#suppressing-backlog-tail

相關內容