尝试在Docker中使用supervisor捕获我的应用程序日志。
这是我的supervisord.conf文件:
这是我的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。
这不是这个问题的重复,因为我在一个容器中运行了多个进程。