【发布时间】:2015-09-19 08:49:38
【问题描述】:
尝试使用 docker 中的主管捕获我的应用程序的日志。
这是我的 supervisord.conf:
[supervisord]
logfile=/dev/null
nodaemon=true
[program:autofs]
command=automount -f
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
[program:split-pdf]
command=bin/split-pdf-server
directory=/root/split-pdf
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
启动容器后一切正常,我可以看到我的应用程序运行的结果(它在网络共享上创建 pdf 文件)
但是日志显示我的应用没有输出:
015-07-02 00:39:26,119 CRIT Supervisor running as root (no user in config file)
2015-07-02 00:39:26,124 INFO supervisord started with pid 5
2015-07-02 00:39:27,127 INFO spawned: 'split-pdf' with pid 8
2015-07-02 00:39:27,130 INFO spawned: 'autofs' with pid 9
2015-07-02 00:39:28,132 INFO success: split-pdf entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2015-07-02 00:39:28,132 INFO success: autofs entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
这是我在附加到 docker 容器时看到的唯一输出。
我在 ubuntu 15.04 docker 1.7.0
这不是this question 的重复,因为我在一个容器中运行多个进程。
【问题讨论】:
-
能否尝试修改 stdout_logfile=/tmp/autofs.log 和 stdout_logfile=/tmp/split-pdf.log 并重新构建/重新启动,仅用于测试?
标签: logging docker supervisord