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

后端 未结 1 2009
不思量自难忘°
不思量自难忘° 2020-12-18 15:29

I want to temporailiy turn on debug messages in a production pyramid web project so I adjusted the production.ini file, pushed it to Heroku and saw only error a

相关标签:
1条回答
  • 2020-12-18 16:25

    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.

    0 讨论(0)
提交回复
热议问题