gpt4 book ai didi

pyramid - 未显示“gunicorn --paster”日志消息

转载 作者:行者123 更新时间:2023-12-01 02:19:16 24 4
gpt4 key购买 nike

我正在使用 --paster 启动 gunicorn运行 Pyramid 的选项。

gunicorn -w 1 --paster development.ini

例如,gunicorn 自己的消息在控制台上显示良好
2014-02-20 22:38:50 [44201] [INFO] Starting gunicorn 18.0
2014-02-20 22:38:50 [44201] [INFO] Listening at: http://0.0.0.0:6543 (44201)
2014-02-20 22:38:50 [44201] [INFO] Using worker: sync

但是,我的 Pyramid 应用程序中的日志消息没有显示出来。

如果我使用 pserve development.ini , 使用 waitress作为 WSGI 服务器,日志消息显示在控制台上就好了。

我的 development.ini包括一个漂亮的 Vanilla 日志配置部分。
[loggers]
keys = root, apipython

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_apipython]
level = DEBUG
handlers =
qualname = apipython

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = DEBUG
formatter = generic

[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s

我不知道为什么当我使用 gunicorn 时日志没有显示出来。

最佳答案

不要将 pserve 与 gunicorn 一起使用,它已被弃用,并且很可能会在某些下一个版本中被删除。

Gunicorn 有 "logconfig" setting ,只需通过命令行参数将其设置为您的配置:

gunicorn -w 1 --paster development.ini --log-config development.ini

或在相同的配置中:
[server:main]
use = egg:gunicorn#main
logconfig = %(here)s/development.ini

关于pyramid - 未显示“gunicorn --paster”日志消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21927811/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com