Fly logs not capturing supervisord subprocess output

I’m using supervisord to run both nginx and a node.js app, following the example here. The only log lines that are captured, however, are from supervisord itself, while the two subprocesses are swallowed somewhere. I’ve tried replacing the commands with plain echos to confirm it wasn’t the processes themselves not logging. Here is my supervisor.conf:

[supervisord]
logfile=/dev/stdout
logfile_maxbytes=0
loglevel=info
pidfile=/tmp/supervisord.pid
nodaemon=true
user=root

[unix_http_server]
file=/tmp/supervisor.sock
username=dummy
password=dummy

[program:nginx]
command=nginx

[program:app]
command=npm run start

I’ve also tried adding the following lines to each program: block, but no luck:

logfile=/dev/stdout
logfile_maxbytes=0

Sounds like you may not have configured nginx to log to stdout/stderr.

Try this in your nginx config:

access_log /dev/stdout;
error_log /dev/stderr;

Additionally, your supervisord config can have the following for each program:

stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

Thanks - the stdout_* config lines were what I needed in supervisor.conf.

1 Like