docker 發送內部 cerbot 日誌文件到主機 journald (docker send internal cerbot log file to host journald)


問題描述

docker 發送內部 cerbot 日誌文件到主機 journald (docker send internal cerbot log file to host journald)

我正在構建一個嵌入了 nginx 和 certbot 的 docker 容器。

我希望能夠在主機上使用 journald 記錄 nginx 和 cerbot 的輸出。

nginx 輸出已經進入控制台,主機 journald 對此輸出工作正常。

我的問題是我需要能夠將以下文件發送到 journald。我希望能夠在主機上跟踪這些文件,因此需要實時發送。

文件是:

access.log
error.log
letsencrypt.log

certbot (letsencrypt) 似乎沒有提供除了寫入日誌文件之外的任何選擇。

所以我想我正在尋找一些進程來跟踪上述日誌文件,然後將輸出發送到控制台。

鑑於 nginx 已經連接到控制台,我能想到的唯一選擇是讓一個主線程假脫機。線程,每個進程/文件一個,然後將上述文件的所有輸出發送到“主”線程,然後將這些輸出到控制台。

我希望有一個更簡單的前進的方向。


參考解法

方法 1:

Give following a try:

  1. Disable letsencrypt log rotation
  2. soft link those files to /dev/stdout in container

  3. </ol>

    ln ‑s /dev/stdout access.log
    ln ‑s /dev/stdout error.log
    ln ‑s /dev/stdout letsencrypt.log
    

    (by Brett SuttonJohn Siu)

    參考文件

    1. docker send internal cerbot log file to host journald (CC BY‑SA 2.5/3.0/4.0)

#Certbot #systemd-journald #docker #nginx






相關問題

certbot-auto /letsencrypt 為指向同一服務器的多個域設置一個密鑰 (certbot-auto / letsencrypt setting up one key for multiple domains pointing to the same server)

certbot 工作時 Phpseclib 早期執行 (Phpseclib early execution while certbot working)

“httpd.service 的作業失敗,因為控制進程以錯誤代碼退出。” 我該如何解決? ("Job for httpd.service failed because the control process exited with error code." How do I fix this?)

無法使用 certbot renew/Letsencrypt 續訂證書 (Cannot renew certificates with certbot renew/Letsencrypt)

為 AWS 中託管的網站設置 HTTPS,但指向局域網中的 webAPI (Setting up HTTPS for a website hosted in AWS, but points to a webAPI in the local area network)

docker 發送內部 cerbot 日誌文件到主機 journald (docker send internal cerbot log file to host journald)

Nginx 允許來自任何域的流量 (Nginx allow traffic from any domain)

如何有效地為 2 個遠程節點使用 Kubernetes (How to use Kubernetes effectively for 2 distant nodes)

如何在 docker 映像中創建目錄? (How can I make dir inside docker image?)

更新 Certbot 時出現“連接超時(可能是防火牆問題)” ("Timeout during connect (likely firewall problem)" while renewing Certbot)

安裝certbot後找不到nginx頁面錯誤 (nginx page not found error after certbot installation)

Nginx 和 certbot 的 ERR_SSL_PROTOCOL_ERROR (ERR_SSL_PROTOCOL_ERROR with Nginx & certbot)







留言討論