Why is my log level not being used when using loadapp from paste.deploy?

左心房为你撑大大i 提交于 2019-11-29 08:49:19

PasteDeploy does not actually assume responsibility for configuring logging. This is a little quirk where the INI file is dual-purposed. There are sections that PasteDeploy cares about, and there are sections that logging.config.fileConfig cares about, and both must be run to fully load an INI file.

If you follow the pyramid wrappers for doing this, you'd do:

pyramid.paster.setup_logging(inipath)
pyramid.paster.get_app(inipath)

The main reason you would use these instead of doing it yourself is that they support doing "the right thing" when inipath contains a section specifier like development.ini#myapp, which fileConfig would crash on.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!