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

2008-01-15 Thread Phillip J. Eby
At 02:05 PM 1/15/2008 +, Chris Withers wrote: >Phillip J. Eby wrote: >>>Why would they need to? The logging module has its own registry of loggers. >>> >>>getLogger('x.y.z') only creates a logger if it doesn't already exist... >>You're only shifting the issue from taking loggers as arguments, t

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

2008-01-15 Thread Chris Withers
Phillip J. Eby wrote: >> Why would they need to? The logging module has its own registry of >> loggers. >> >> getLogger('x.y.z') only creates a logger if it doesn't already exist... > > You're only shifting the issue from taking loggers as arguments, to > logger *names* as arguments. Huh? How

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

2008-01-14 Thread Phillip J. Eby
At 05:15 PM 1/14/2008 +, Chris Withers wrote: >Phillip J. Eby wrote: >>At 02:03 PM 12/21/2007 +, Chris Withers wrote: >>>I think I'm missing something: what in the logging package makes >>>you log by which module issued the message? >>That's the conventional usage: modules that use logging

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

2008-01-14 Thread Chris Withers
Phillip J. Eby wrote: > At 02:03 PM 12/21/2007 +, Chris Withers wrote: >> I think I'm missing something: what in the logging package makes you >> log by which module issued the message? > > That's the conventional usage: modules that use logging usually use a > static logger based on module

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

2007-12-26 Thread Graham Dumpleton
On 24/12/2007, Manlio Perillo <[EMAIL PROTECTED]> wrote: > Graham Dumpleton ha scritto: > > On 22/12/2007, Manlio Perillo <[EMAIL PROTECTED]> wrote: > >> Graham Dumpleton ha scritto: > >>> [...] > >>> > >>> The more and more that this discussion goes on, the conclusion I am > >>> coming to is that

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

2007-12-24 Thread Manlio Perillo
Graham Dumpleton ha scritto: > On 22/12/2007, Manlio Perillo <[EMAIL PROTECTED]> wrote: >> Graham Dumpleton ha scritto: >>> [...] >>> >>> The more and more that this discussion goes on, the conclusion I am >>> coming to is that WSGI applications should simply not be using the web >>> server log fil

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

2007-12-24 Thread Manlio Perillo
Robert Brewer ha scritto: > [...] > I still say the answer to "should logging be done by the application or > server?" is "neither". We need a component that covers the "everything > else" of WSGI; that is, the environment in which servers and > applications are instantiated, connected, started, st

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

2007-12-23 Thread Robert Brewer
Graham Dumpleton wrote: > On 22/12/2007, Brian Smith <[EMAIL PROTECTED]> wrote: > > Manlio Perillo wrote: > > > Instead of using sys.stderr, a better solution is to add a new log > > > object to the WSGI environment dictionary, so that each > > > application can have its error log redirected to dif

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

2007-12-22 Thread Graham Dumpleton
On 22/12/2007, Manlio Perillo <[EMAIL PROTECTED]> wrote: > Graham Dumpleton ha scritto: > > [...] > > > > The more and more that this discussion goes on, the conclusion I am > > coming to is that WSGI applications should simply not be using the web > > server log files for application logging at al

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

2007-12-22 Thread Manlio Perillo
Graham Dumpleton ha scritto: > [...] > It therefore seemed more consistent for only wsgi.errors to be bound > to request, given that it comes through request environment. This can > then map to internal Apache ap_log_rerror() function, allowing client > IP to be listed against message in error log

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

2007-12-22 Thread Manlio Perillo
Graham Dumpleton ha scritto: > [...] > > The more and more that this discussion goes on, the conclusion I am > coming to is that WSGI applications should simply not be using the web > server log files for application logging at all. > The problem with this is that log files cannot be easily rota

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

2007-12-21 Thread Graham Dumpleton
On 22/12/2007, Brian Smith <[EMAIL PROTECTED]> wrote: > Manlio Perillo wrote: > > > I can modify the code, so that: > > - sys.stderr for the main interpreter goes to the main error log > > - sys.stderr for subinterpreters goes to the error log declared in the > >HTTP location where the WSGI app

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

2007-12-21 Thread Graham Dumpleton
On 22/12/2007, Brian Smith <[EMAIL PROTECTED]> wrote: > Manlio Perillo wrote: > > Graham Dumpleton ha scritto: > > > On 21/12/2007, Brian Smith <[EMAIL PROTECTED]> wrote: > > >> The specification should then also explicitly say > > >> that WSGI applications should not redirect logging > > >> output

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

2007-12-21 Thread Brian Smith
Manlio Perillo wrote: > I can modify the code, so that: > - sys.stderr for the main interpreter goes to the main error log > - sys.stderr for subinterpreters goes to the error log declared in the >HTTP location where the WSGI application is "mounted" I think that makes sense. To effectively h

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

2007-12-21 Thread Manlio Perillo
Brian Smith ha scritto: > Manlio Perillo wrote: > [...] >> This is the same for Nginx. >> sys.stderr is linked to the nginx main cycle logging, >> wsgi.errors to the request logging. > > In Nginx, there is only one thread, right? Right. It is an asynchronous server, with support to multiprocess

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

2007-12-21 Thread Brian Smith
Phillip J. Eby wrote: > There are other logging systems out there besides the Python > logging module -- and some of them are better for their > specific purposes. If I was using a framework, I would use that framework's logging package. But, I specifically want to limit my dependencies as much

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

2007-12-21 Thread Brian Smith
Manlio Perillo wrote: > Graham Dumpleton ha scritto: > > On 21/12/2007, Brian Smith <[EMAIL PROTECTED]> wrote: > >> The specification should then also explicitly say > >> that WSGI applications should not redirect logging > >> output to wsgi.errors or anywhere else. > >> In fact, if that was done,

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

2007-12-21 Thread Phillip J. Eby
At 02:03 PM 12/21/2007 +, Chris Withers wrote: >I think I'm missing something: what in the logging package makes you >log by which module issued the message? That's the conventional usage: modules that use logging usually use a static logger based on module name. Take a look at the distutil

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

2007-12-21 Thread Chris Withers
Phillip J. Eby wrote: > > There are other logging systems out there besides the Python logging > module -- and some of them are better for their specific > purposes. Can you give some examples? > And the Python logging module doesn't give you any > WSGI-level control over output. What do yo

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

2007-12-21 Thread Chris Withers
Brian Smith wrote: > It would make more sense for the WSGI specification to explicitly say > that WSGI gateways are responsible for setting the default logging > output location. Yes, although by this I assume you mean "WSGI gateways are responsible for allowing configuration of log handlers for

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

2007-12-21 Thread Chris Withers
Graham Dumpleton wrote: > At least in the context of Apache, wsgi.errors is different to > sys.stderr or a global logging module output target. This is because > wsgi.errors is linked to the actual request and so any output can be > correctly redirected to a per virtual host error log. Yeah, but t

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

2007-12-21 Thread Manlio Perillo
Graham Dumpleton ha scritto: > On 21/12/2007, Brian Smith <[EMAIL PROTECTED]> wrote: >> The >> specification should then also explicitly say that WSGI applications >> should not redirect logging output to wsgi.errors or anywhere else. In >> fact, if that was done, there would be no reason to have w

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

2007-12-21 Thread Manlio Perillo
Graham Dumpleton ha scritto: > On 21/12/2007, Chris Withers <[EMAIL PROTECTED]> wrote: >> Manlio Perillo wrote: > [...] >>> In mod_wsgi for nginx I now redirect sys.stderr to server log file (as >>> suggested by Graham). >> I've never really understood this desire to do *anything* with >> sys.stder

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

2007-12-20 Thread Graham Dumpleton
On 21/12/2007, Brian Smith <[EMAIL PROTECTED]> wrote: > The > specification should then also explicitly say that WSGI applications > should not redirect logging output to wsgi.errors or anywhere else. In > fact, if that was done, there would be no reason to have wsgi.errors in > the first place. A

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

2007-12-20 Thread Phillip J. Eby
At 07:44 AM 12/21/2007 +0700, Brian Smith wrote: >In >fact, if that was done, there would be no reason to have wsgi.errors in >the first place. There are other logging systems out there besides the Python logging module -- and some of them are better for their specific purposes. And the Python

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

2007-12-20 Thread Brian Smith
Graham Dumpleton wrote: > > > 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') > > > > I'm miss

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

2007-12-20 Thread Graham Dumpleton
On 21/12/2007, Chris Withers <[EMAIL PROTECTED]> wrote: > Manlio Perillo wrote: > >> 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 > >> th

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

2007-12-20 Thread Chris Withers
Manlio Perillo wrote: >> 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 soc

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

2007-12-19 Thread Phillip J. Eby
At 12:12 PM 12/19/2007 +0100, Manlio Perillo wrote: >Phillip J. Eby ha scritto: >>At 11:51 PM 12/18/2007 +0100, Manlio Perillo wrote: >>>Phillip J. Eby ha scritto: At 10:10 PM 12/18/2007 +0100, Manlio Perillo wrote: >Ok. >Here I would just say that when someone install something on its

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

2007-12-19 Thread Manlio Perillo
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 li

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

2007-12-19 Thread Chris Withers
Graham Dumpleton wrote: > Where does setting up 'logging' module configuration fall in all of > this and who/what should handle it? Indeed, this is definitely something I've wondered myself... > """paster, when loading an application via the paster serve, shell or > setup-app commands, calls the

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

2007-12-19 Thread Manlio Perillo
Phillip J. Eby ha scritto: > At 11:51 PM 12/18/2007 +0100, Manlio Perillo wrote: >> Phillip J. Eby ha scritto: >>> At 10:10 PM 12/18/2007 +0100, Manlio Perillo wrote: Ok. Here I would just say that when someone install something on its system, it should at least know what he is doin

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

2007-12-18 Thread Graham Dumpleton
On 19/12/2007, Ian Bicking <[EMAIL PROTECTED]> 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 h

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

2007-12-18 Thread Ian Bicking
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. I guess paster serve technically also sets up the process, not just the server

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

2007-12-18 Thread Graham Dumpleton
Where does setting up 'logging' module configuration fall in all of this and who/what should handle it? 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 func

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

2007-12-18 Thread Brian Smith
Phillip J. Eby wrote: > Range support would be a good example of something > where an option isn't necessary, since properly-written Range > support in the server should be able to tell when the > application has already handled the necessary range-ing of > the output. Thus, having an option t

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

2007-12-18 Thread Phillip J. Eby
At 11:51 PM 12/18/2007 +0100, Manlio Perillo wrote: >Phillip J. Eby ha scritto: >>At 10:10 PM 12/18/2007 +0100, Manlio Perillo wrote: >>>Ok. >>>Here I would just say that when someone install something on its >>>system, it should at least know what he is doing. >>And I repeat: you're welcome to yo

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

2007-12-18 Thread Ian Bicking
Manlio Perillo wrote: > Phillip J. Eby ha scritto: >> At 09:06 PM 12/17/2007 +0100, Manlio Perillo wrote: >>> Phillip J. Eby ha scritto: This is precisely why WSGI doesn't really have any "configuration" defined, because the whole idea is that it should be as "plug-and-play" as pos

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

2007-12-18 Thread Manlio Perillo
Phillip J. Eby ha scritto: > At 10:10 PM 12/18/2007 +0100, Manlio Perillo wrote: >> Ok. >> Here I would just say that when someone install something on its >> system, it should at least know what he is doing. > > And I repeat: you're welcome to your opinions about what's good or bad, > but that

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

2007-12-18 Thread Phillip J. Eby
At 10:10 PM 12/18/2007 +0100, Manlio Perillo wrote: >Ok. >Here I would just say that when someone install something on its >system, it should at least know what he is doing. And I repeat: you're welcome to your opinions about what's good or bad, but that has nothing to do with WSGI's design rati

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

2007-12-18 Thread Manlio Perillo
Phillip J. Eby ha scritto: > At 09:50 PM 12/18/2007 +0100, Manlio Perillo wrote: >> Phillip J. Eby ha scritto: >>> At 09:06 PM 12/17/2007 +0100, Manlio Perillo wrote: Phillip J. Eby ha scritto: > This is precisely why WSGI doesn't really have any "configuration" > defined, because the

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

2007-12-18 Thread Phillip J. Eby
At 09:50 PM 12/18/2007 +0100, Manlio Perillo wrote: >Phillip J. Eby ha scritto: >>At 09:06 PM 12/17/2007 +0100, Manlio Perillo wrote: >>>Phillip J. Eby ha scritto: This is precisely why WSGI doesn't really have any "configuration" defined, because the whole idea is that it should be a

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

2007-12-18 Thread Manlio Perillo
Phillip J. Eby ha scritto: > At 09:06 PM 12/17/2007 +0100, Manlio Perillo wrote: >> Phillip J. Eby ha scritto: >>> This is precisely why WSGI doesn't really have any "configuration" >>> defined, because the whole idea is that it should be as >>> "plug-and-play" as possible. Server-level configur

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

2007-12-17 Thread Phillip J. Eby
At 09:06 PM 12/17/2007 +0100, Manlio Perillo wrote: >Phillip J. Eby ha scritto: >>This is precisely why WSGI doesn't really have any "configuration" >>defined, because the whole idea is that it should be as >>"plug-and-play" as possible. Server-level configuration options >>are a liability to b

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

2007-12-17 Thread Manlio Perillo
Phillip J. Eby ha scritto: > At 07:33 PM 12/17/2007 +0100, Manlio Perillo wrote: > [...] > > And it's also irrelevant: WSGI applications are composable, which means > that not only does the application deployer not necessarily have any > idea what the application does, the *author* might not kno

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

2007-12-17 Thread Phillip J. Eby
At 07:33 PM 12/17/2007 +0100, Manlio Perillo wrote: >Ian Bicking ha scritto: > > [...] > > > > The user shouldn't have to anticipate what an application can or should > > do, beyond what the spec says. > >I disagree. > >The intent of mod_wsgi for nginx, among other things, is to have an >"integrate

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

2007-12-17 Thread Manlio Perillo
Ian Bicking ha scritto: > [...] > > The user shouldn't have to anticipate what an application can or should > do, beyond what the spec says. I disagree. The intent of mod_wsgi for nginx, among other things, is to have an "integrated" deployment platform for running WSGI applications; so the

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

2007-12-17 Thread Manlio Perillo
Manlio Perillo ha scritto: > [...] > >> You should be able to detect whether interference is allowed based on >> the response status, shouldn't you? > > Right. > >> That is, if there is a range >> request and the application replies 200 OK, you can change that and >> apply the ranges. But if

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

2007-12-17 Thread Ian Bicking
Manlio Perillo wrote: >> That is, if there is a range request and the application replies 200 >> OK, you can change that and apply the ranges. But if the application >> replies with 206 Partial Content then the range has already been >> applied and the server shouldn't do anything to it. >> >

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

2007-12-17 Thread Phillip J. Eby
At 04:44 PM 12/17/2007 +, Chris Withers wrote: >Manlio Perillo wrote: > > 2) handle the range request in the WSGI application. > >Its not hard as long as you do not implement multiple ranges support. > > > >If your object database supports seeks, this should be the most > >efficient

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

2007-12-17 Thread Manlio Perillo
Ian Bicking ha scritto: > Manlio Perillo wrote: >> Chris Withers ha scritto: >>> Manlio Perillo wrote: 2) handle the range request in the WSGI application. Its not hard as long as you do not implement multiple ranges support. If your object database supports seeks, t

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

2007-12-17 Thread Manlio Perillo
Robert Brewer ha scritto: > Chris Withers wrote: >> Manlio Perillo wrote: >>> 2) handle the range request in the WSGI application. >>>Its not hard as long as you do not implement multiple ranges >> support. >>>If your object database supports seeks, this should be the most >>>efficient

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

2007-12-17 Thread Ian Bicking
Manlio Perillo wrote: > Chris Withers ha scritto: >> Manlio Perillo wrote: >>> 2) handle the range request in the WSGI application. >>>Its not hard as long as you do not implement multiple ranges support. >>> >>>If your object database supports seeks, this should be the most >>>efficien

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

2007-12-17 Thread Robert Brewer
Chris Withers wrote: > Robert Brewer wrote: > > Apache will interfere, and try to re-apply the range to whatever you > > emit. The only solution we've found so far is to tell the app to > ignore > > any 'Range' request header when running behind Apache, and just let > > Apache have its way. See htt

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

2007-12-17 Thread Chris Withers
Robert Brewer wrote: > Apache will interfere, and try to re-apply the range to whatever you > emit. The only solution we've found so far is to tell the app to ignore > any 'Range' request header when running behind Apache, and just let > Apache have its way. See http://www.cherrypy.org/changeset/13

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

2007-12-17 Thread Robert Brewer
Chris Withers wrote: > Manlio Perillo wrote: > > 2) handle the range request in the WSGI application. > >Its not hard as long as you do not implement multiple ranges > support. > > > >If your object database supports seeks, this should be the most > >efficient solution. > > This is pro

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

2007-12-17 Thread Manlio Perillo
Chris Withers ha scritto: > Manlio Perillo wrote: >> 2) handle the range request in the WSGI application. >>Its not hard as long as you do not implement multiple ranges support. >> >>If your object database supports seeks, this should be the most >>efficient solution. > > This is proba

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

2007-12-17 Thread Chris Withers
Manlio Perillo wrote: > 2) handle the range request in the WSGI application. >Its not hard as long as you do not implement multiple ranges support. > >If your object database supports seeks, this should be the most >efficient solution. This is probably what's wanted. So, if a wsgi app

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

2007-12-14 Thread Ian Bicking
Chris Withers wrote: > Hi All, > > What's the best way to serve large files (say detailed images or pdfs) > from a wsgi app? > > Is there special support for this? > > Also, does wsgi offer anything to help with http range requests and the > like? It's not part of any WSGI standard, but in We

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

2007-12-14 Thread Manlio Perillo
Chris Withers ha scritto: > Manlio Perillo wrote: >> >> Note however that this is an optional feature, so a wsgi gateway is >> not required to implement it. > > What happens if the app is expecting the gateway to support it and the > gateway does not? > You can still use something like: class

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

2007-12-10 Thread Phillip J. Eby
At 12:08 PM 12/10/2007 +, Chris Withers wrote: >Hi All, > >What's the best way to serve large files (say detailed images or pdfs) >from a wsgi app? > >Is there special support for this? That's what the iteration part of the protocol is for (well, and a few other things). If you're not servin

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

2007-12-10 Thread Chris Withers
Hi All, What's the best way to serve large files (say detailed images or pdfs) from a wsgi app? Is there special support for this? Also, does wsgi offer anything to help with http range requests and the like? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting