我有一個[程序:x]運行,它打印/ sys.stdout.writes很多東西。在[supervisord]的AUTO childlogdir中或[program:x]的stdout_logfile中都沒有出現這種情況。我是否錯過了某些內容?supervisord日誌不顯示我的輸出
如何從[program:x]捕獲打印或標準輸出的所有內容?
在我的計劃,我明確地做兩個,
print "something"
sys.stdout.write("something")
相關supervisord.conf文件
[supervisord]
childlogdir = %(here)s/../logs/supervisord/
logfile = %(here)s/../logs/supervisord/supervisord.log
logfile_maxbytes = 100MB
logfile_backups = 10
loglevel = info
pidfile = %(here)s/../logs/supervisord/supervisord.pid
umask = 022
nodaemon = false
nocleanup = false
[program:x]
directory = %(here)s/../
command = python file.py
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile = /appropriate-path/to/access.log
你一定程序打印到'stdout'而不是'標準錯誤'? –
編輯了更多信息的問題。當我做一個sys.stdout.write,它應該打印到標準輸出 – zubinmehta
那麼你的''[program:..]'的supervisord配置是什麼?哦,並且嘗試'sys.stdout.flush()'以確保它不是緩衝區。 –