在创建多克尔集装箱,同时拥有的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'捕获。为什么不是这样? –