supervisord stdout_logfile 不生效解決辦法
阿新 • • 發佈:2018-02-06
文件 cto path stream app dir flow art pri 配置文件
[program:p2p_recv] command = /ebs_data/appenv3/bin/python xmpp_p2p_recv.pyc process_name = p2p_recv_%(process_num)02d numprocs = 1 directory = /ebs_data/im/rec/ priority = 20 stdout_logfile = /ebs_data/recv.out.log stderr_logfile = /ebs_data/recv.err.log autostart = true autorestart = true startsecs = 10 environment = PATH="/ebs_data/appenv3/bin:$PATH",TZ="UTC", stopwaitsecs = 30
解決辦法
在command中添加-u參數,如下所示:
command = /ebs_data/appenv3/bin/python -u xmpp_p2p_recv.pyc
或者
Flush each stream after writing like sys.stdout.flush() or run with the streams unbuffered using python -u.
參考鏈接
github
stackoverflow
supervisord stdout_logfile 不生效解決辦法