Logging re-initialized in make_app()

Mads Kiilerich mads at kiilerich.com
Fri Jan 10 11:39:02 UTC 2020


On 12/12/19 12:34 AM, Wolfgang Scherer wrote:
>
> I finished the analysis of logging initialization (http://sw-amt.ws/kallithea-deploy/html/overview.html#bug-logging-re-initialized-in-make-app). Since I don't think that all the packages will be updated any time soon, I will stay with the minimum required corrections in Kallithea (see attached patch).
>
> The initialization schema is generally
>
> 1. Initialize logging (each toolkit rolls their own, but defaults
>     :attr:`__file__` and :attr:`here` are always set)
> 2. Load WSGI application (:func:`paste.deploy.loadapp`)
>
> Wolfgang
>

Thanks for the report, analysis and proposals.

We fixed it on the stable branch with 
https://kallithea-scm.org/repos/kallithea/changeset/f9c55f700ad9f3eb81bb88ac44f11d4713d5e17a 
and 
https://kallithea-scm.org/repos/kallithea/changeset/488b52cad8905eac29645b8dad77117bfd73184d 
.

Where we ended up, deciding to support the paste convention, I don't see 
how things can change / be fixed elsewhere. For example paste.deploy and 
TurboGears are right in not touching logging configuration at all. Paste 
& other high WSGI servers are right in configuring logging ... and seem 
to consistently follow the the paste.script convention. We now also use 
that convention when not using paste.script - and all other web-ish apps 
should probably do the same. It would be nice if standard fileConfig got 
something similar built-in and everybody started using that instead ... 
but that doesn't seem feasible. And it barely seems justified to to use 
some other library just for this.

/Mads


More information about the kallithea-general mailing list