[Web-SIG] serving (potentially large) files through wsgi?

Manlio Perillo manlio_perillo at libero.it
Wed Dec 19 15:09:47 CET 2007

Chris Withers ha scritto:
> [...]
> For me, it does feel like the responsibility of the server to configure 
> logging, and I think this is something that should be documented 
> somewhere. Afterall, as you guys have been discussing, it's the server 
> that holds configuration for things like listening sockets, etc and 
> logging feels like that kind of thing to me...

In mod_wsgi for nginx I now redirect sys.stderr to server log file (as 
suggested by Graham).

So, the application can setup the logging module to use sys.stderr as 

However there are some problems.
The log object has a fixed error level (NGX_LOG_ERR);
this means that every message logged using this object will have this 
error level, even if I do, as example:
log.info('just an info message')

This can be a problem if I use a log filter that will send an email 
every time it sees a NGX_LOG_ERR message in log file.

A better solution could be the integration with the logging module.

However there are some problems here, too, since log levels from nginx 
and the logging module differs.

> cheers,
> Chris

Manlio Perillo

More information about the Web-SIG mailing list