【发布时间】:2018-12-03 16:33:41
【问题描述】:
有人可以告诉我如何将flask standout 发送到guinicorn 原木。
以下是我的代码
@app.route("/")
def home():
print "print statement"
return "<h1>hello World</h1>"
Gunicorn 命令
gunicorn test:app -b 0.0.0.0:5005 --access-logfile ./access.log --error-logfile error.log --log-file gunicorn.log --capture-output -R --reload
但是,只有在我关闭应用程序后,我才能在 gunicorn.log 中stdout。
[2018-12-03 11:27:39 -0500] [68235] [INFO] Starting gunicorn 19.9.0
[2018-12-03 11:27:39 -0500] [68235] [INFO] Listening at: http://0.0.0.0:5005 (68235)
[2018-12-03 11:27:39 -0500] [68235] [INFO] Using worker: sync
[2018-12-03 11:27:39 -0500] [68238] [INFO] Booting worker with pid: 68238
[2018-12-03 11:29:13 -0500] [68235] [INFO] Handling signal: int
[2018-12-03 11:29:14 -0500] [68238] [INFO] Worker exiting (pid: 68238)
print statement
print statement
print statement
[2018-12-03 11:29:14 -0500] [68235] [INFO] Shutting down: Master
【问题讨论】:
标签: python python-2.7 flask gunicorn