首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将烧瓶Stadout重定向到Guinicorn日志文件

将烧瓶Stadout重定向到Guinicorn日志文件
EN

Stack Overflow用户
提问于 2018-12-03 16:33:41
回答 1查看 66关注 0票数 0

有谁能告诉我怎么把烧瓶送到吉尼克恩原木上。

以下是我的代码

代码语言:javascript
复制
@app.route("/")
def home():
    print "print statement"
    return "<h1>hello World</h1>"

Gunicorn命令

代码语言:javascript
复制
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

但是,只有在我关闭应用程序之后,我才能在stdout in gunicorn.log

代码语言:javascript
复制
[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
EN

回答 1

Stack Overflow用户

发布于 2018-12-03 16:48:54

使用print代替app.logger.info(<expr>)

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53597983

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档