在創建多克爾集裝箱,同時擁有的Apache2error.log
和尾部它通過docker logs -f <my_container>
我使用運行主管容器爲入口點與此配置:說明關於監事和尾巴在Apache的error.log中
[supervisord]
nodaemon = true
environment = PLACEHOLDER=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:apache]
command=apache2ctl -DFOREGROUND
autostart=true
autorestart=true
startretries=1
startsecs=1
stderr_logfile=/var/log/apache2/error.log
stdout_logfile=/var/log/apache2/access.log
user=root
killasgroup=true
stopasgroup=true
[program:apache2-error]
command= tail -f /var/log/apache2/error.log
autostart = true
autorestart = true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:apache2-access]
command= tail -f /var/log/apache2/access.log
autostart = true
autorestart = true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
這工作得很好,但我不明白爲什麼這不工作,如果我這個替換[program:apache]
會議:
[program:apache]
command=apache2ctl -DFOREGROUND
autostart=true
autorestart=true
startretries=1
startsecs=1
user=root
killasgroup=true
stopasgroup=true
即:沒有明確設置stderr
和stdout
日誌文件docker logs -f <my_container>
命令不起作用,但在容器tail -f /var/logs/apache2/access.log
和tail -f /var/logs/apache2/error.log
內工作正常。
有人能解釋我爲什麼supervisor
和docker logs -f <my_container>
由於在該配置的改變兩個不同的作品?
感謝
謝謝您的回答,但我不明白一件事:理論上一節'[程序:Apache2的訪問]'部分拖尾'access.log'文件,所以我認爲從輸出本節來臨應該由'docker logs -f'捕獲。爲什麼不是這樣? –