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

旧街凉风 提交于 2019-12-04 06:23:09

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

You can just remove the logfile in your supervisord.conf and every logs will show as container logs when you enter docker logs <container_id> --tail=100 -f

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!