[Web-SIG] again about logging in WSGI

Phillip J. Eby pje at telecommunity.com
Fri Nov 23 14:09:57 CET 2007

At 01:25 PM 11/23/2007 +0100, Manlio Perillo wrote:
>Phillip J. Eby ha scritto:
>>At 11:57 AM 11/23/2007 +0100, Manlio Perillo wrote:
>>>As I have written in a previous thread, I would like to use nginx
>>>logging system in a WSGI application (of course the same is valid for
>>>A first problem is that the wsgi.errors stream defined in the
>>>environment dictionary is valid only for the current request, but I want
>>>to use a stream valid for the entire process lifetime.
>>>I think that there are two solutions:
>>>1) call an application supplied `init_application(environ)` callable,
>>>     where the environ dictionary contains the "right" wsgi.errors stream
>>>     object
>>>2) add to the environ dictionary a `wsgi.global_errors` stream object
>>>Any suggestions?
>>Yes: provide an 'nginx.global_errors' stream object, as a 
>>server-specific extension.
>Ok, thanks.
>I think that I will use the `mod_wsgi` "namespace", since this same 
>interface can be used by other WSGI gateway implementations embeded 
>in a web server.

Er, no, that's precisely why you should NOT use that namespace.  That 
goes against the very reason for having namespaces in the first place 
-- to ensure that each project is free to add its own extensions 
without colliding with those created by another project.

>By the way: any proposal for "standardize" common "namespaces"?

Yes: use your own private namespaces for anything you create.

Once you've implemented your extension under your private name, and 
published a spec for it, *then*, if other people commit to 
implementing that spec, then it can begin the process for getting a 
wsgi.org standardized name.

Until then, however, extensions must be kept in a private, 
project-specific namespace, as per the WSGI spec.

More information about the Web-SIG mailing list