Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

supervisord disable log files or use logfile=/dev/stdout

[supervisord]
nodaemon=true
logfile=/dev/stdout
pidfile=/var/run/supervisord.pid
childlogdir=/var/log/supervisor

When I do this supervisor will crash because it cannot seek in /dev/stdout

How can I disable supervisord creating any log files in my docker container?

like image 960
Gert Cuykens Avatar asked Aug 12 '17 01:08

Gert Cuykens


1 Answers

For the main supervisor, nodaemon will cause logs to go to stdout

[supervisord]
nodaemon=true
logfile=/dev/null
logfile_maxbytes=0

Then send the logs for each managed process to the stdout file descriptor /dev/fd/1

[program:x]
command=echo test
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true

Or if you prefer to keep stderr on a different stream:

[program:x]
command=echo test
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0
like image 130
Matt Avatar answered Sep 20 '22 19:09

Matt