Answer the question
In order to leave comments, you need to log in
How to catch gunicorn's STDOUT?
Hey!
In this question, the Python tag curator donated the subprocess library . Here is my code:
with Popen(['gunicorn', 'TS.wsgi', '-b', 'localhost:65535', '--log-level', 'debug'], stdout=PIPE) as p:
for line in iter(p.stdout.readline, b''):
print(f">>> {line.decode()}")
p.stdout.close()
p.wait()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question