I've got a Flask wsgi app, where there are print statements in the 
myapp.wsgi, which take advantage of the "send unhandled print stuff out 
through the apache error log".  This was working fine with Python 
2.7/Ubuntu 16.04, and the output appeared in the apache error.log as 
expected.  But after conversion to Python 3.9/Ubuntu 22.04 (mod_wsgi 4.9.x, 
Flask 2.3.x, I think), the output of print() statements doesn't seem to get 
to the apache log anymore.  Later on in the request handling of the app, I 
have Python logging established (normal stdout, I think), and that output 
does get to the error log, but print() statements still don't.

I assume there is some sort of change in how Python 3 is handling 
stdout/stderr, or how Flask or mod_wsgi interact with that, and the print() 
text never gets out, or goes to a bitbucket, or something, but I can't 
figure out why or how I might fix it.  I've tried a couple things to monkey 
with Python's stdout/stderr before the first print statement, but didn't 
have any luck.  I could go through and replace some of the old print 
statements with Python logging calls, but I'd like to figure this out and 
fix it if possible, if anyone has any ideas or pointers as to what might be 
happening?

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to modwsgi+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/modwsgi/023ebed2-57ac-4a17-a9d3-567660a76aa4n%40googlegroups.com.

Reply via email to