Supervisord does not show stdout from processes

Trying to capture logs of my application using dispatcher manager.

Here is my 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 

After starting the container, everything works, and I see the result of my application (it creates pdf files on a network resource)

But the log does not show the exit from my application:

 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) 

This is the only conclusion that I see when connecting to the docker container.

I am on ubuntu 15.04 docker 1.7.0

This is not a duplicate of this question , because I am running more than one process in a container.

+6
source share
2 answers

It turns out that everything works, but with some delay. When I tried to create a container for another application that produces much more log messages, the messages began to appear in the log file, but with a delay.

The first application I tested contained only 2 lines per task in the log, and I think there is some kind of buffer that needs to be filled before it starts flushing the log file.

+2
source

This is due to pipe buffering.

I managed to get around this problem by running python in unbuffered mode :

 $ docker run -e PYTHONUNBUFFERED=1 imagename 

For a discussion of this issue, see issue-supervisor-stdout No. 10 .

0
source

All Articles