Supervisor: stdout not being captured

Created on 27 Apr 2011  Â·  8Comments  Â·  Source: Supervisor/supervisor

I can't get standard out from a supervisor controlled program, to show up in the logs. Could be a configuration issue, but I can't find the magic combination.

Here's a trivial demo using buildout to reproduce the issue, including a README.txt with instructions. Note that only the stderr log is ever written to, and if 'redirect_stderr=true' is uncommented in the config file, only stderr lands in the stdout log.

[email protected]:pbugni/supervisor_stdout_issue.git

(great tool, btw - thanks!)

Most helpful comment

Flush each stream after writing like sys.stdout.flush() or run with the streams unbuffered using python -u.

All 8 comments

Flush each stream after writing like sys.stdout.flush() or run with the streams unbuffered using python -u.

Ah, but of course. The differing behavior with stderr confused me,
but I see that it's not buffered, so even that makes sense, in
hindsight.

Thanks!

On Apr 27, 2011, at 2:33 PM, mnaberez wrote:

Flush each stream after writing like sys.stdout.flush() or run
with the streams unbuffered using python -u.

Reply to this email directly or view it on GitHub:
https://github.com/Supervisor/supervisor/issues/13#comment_1066821

This was a super useful thread. Helped me out a lot – saying thanks for afar!

This would be a TERRIFIC bit of information to include in your official documentation

+1

It made my day, thanks!

thanks~

mnaberez, thanks for posting this. I had a situation where my task being run by supervisor wasn't logging anything. The sys.stdout.flush() seems to have done the trick.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

felipemachado-sambatech picture felipemachado-sambatech  Â·  74Comments

gregpinero picture gregpinero  Â·  29Comments

cclauss picture cclauss  Â·  62Comments

timonwong picture timonwong  Â·  49Comments

ido50 picture ido50  Â·  95Comments