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

Graham Dumpleton graham.dumpleton at gmail.com
Wed Dec 19 03:41:00 CET 2007

On 19/12/2007, Ian Bicking <ianb at colorstudy.com> wrote:
> Graham Dumpleton wrote:
> > Where does setting up 'logging' module configuration fall in all of
> > this and who/what should handle it?
> I'm not sure.  What I did with paster serve was expedience, I'm not sure
> it's right.

Problem is it has set a precedence of sorts. And in some respects this
is the problem with trying to do certain types of configuration in the
WSGI server as opposed to the application layer. In other words, once
one means of hosting a WSGI application does something like this, with
the result that the same WSGI application component then will not work
as a simple plug and play component in another WSGI server, there is
pressure for the other WSGI servers to provide a similar hook. Thus we
end up with a defacto standard of sorts which isn't part of any
specification and which may not have been the right thing to do in the
first place.

I don't know what the answer is. I guess as long as the such special
set up requirements are well documented in a section dealing with
porting a WSGI component to another WSGI server it is okay, but a few
things I have run across aren't up front with such details and so one
always has to do some digging as to how to get the WSGI component
working in a different environment. :-(


> I guess paster serve technically also sets up the process,
> not just the server (which might justify things like --reload for the
> reloader, which is really process-wide).
> > I ask as I note that in the documentation for Pylons logging it says:
> >
> > """paster, when loading an application via the paster serve, shell or
> > setup-app commands, calls the logging.fileConfig function on that
> > specified ini file if it contains a 'loggers' entry.
> > logging.fileConfig reads the logging configuration from a ConfigParser
> > file."""
> >
> > So, the paster serve is doing special setup for Pylons WSGI
> > components. Without knowing this magic is required, when you take a
> > Pylons WSGI component to another WSGI server, the logging doesn't work
> > as expected. To get it to work one has to duplicate the special things
> > that paster serve is doing in some way.
> It's just using logging.fileConfig, though apparently we backported
> Python 2.5's logging.config module.
> Stuff ends up in paster serve usually because I don't know where else to
> put them.  Of course applications could take options to setup the
> configuration on their own (e.g., paste.translogger sets up logging,
> since without logging it's useless).  This lets applications be a little
> more lazy, which is kind of what the logging module encourages (but only
> kind of).
> --
> Ian Bicking : ianb at colorstudy.com : http://blog.ianbicking.org

More information about the Web-SIG mailing list