Re: Documenting all HTTP requests to an application

2011-05-12 Thread Alec Munro
Nope, haven't needed it yet. This case is a bit special because I want unique routes, but I want to filter out query string values (and ids in urls). I think you have my original question more or less correct. I want to know how the app is being used, so when I rewrite it using Pyramid, I can make

Re: Documenting all HTTP requests to an application

2011-05-11 Thread Daniel Holth
You don't log requests already? Here is one: http://pythonpaste.org/modules/translogger.html Perhaps the format could just log the path without having to do any text processing on the file. I thought your original question was more like 'print out all the routes' without making requests to the ap

Re: Documenting all HTTP requests to an application

2011-05-11 Thread Alec Munro
Thanks Alice. I wasn't sure how to insert/structure middleware, but this page helped: http://wiki.pylonshq.com/display/pylonscookbook/Adding+your+own+middleware My solution looks roughly like this: class RequestLogger(object): """WSGI middleware to log all requests.""" def __init__(self,

Re: Documenting all HTTP requests to an application

2011-05-10 Thread Alice Bevan–McGregor
Create a small bit of middleware to log the environ['REQUEST_URI'] (or other value, as appropriate) of each GET. You can then direct that logger to output to a file, another handler (i.e. you could write one which logs to your database of choice and de-duplicates), etc. Logging to a file then

Re: Documenting all HTTP requests to an application

2011-05-10 Thread Alec Munro
D'oh! I should have specified that I'm using Pylons 0.96 for this particular application. Thanks, Alec On May 10, 3:51 pm, Jasper van den Bosch wrote: > If you use traversal, perhaps in the constructor of your Root resource? > > On 10 May 2011 20:40, Alec Munro wrote: > > > > > > > > > Hi list

Re: Documenting all HTTP requests to an application

2011-05-10 Thread Jasper van den Bosch
If you use traversal, perhaps in the constructor of your Root resource? On 10 May 2011 20:40, Alec Munro wrote: > Hi list, > > I want to create a map of all the requests to an application, to make > it easier to refactor it without breaking it's interfaces. What's the > easiest place to add a fu

Documenting all HTTP requests to an application

2011-05-10 Thread Alec Munro
Hi list, I want to create a map of all the requests to an application, to make it easier to refactor it without breaking it's interfaces. What's the easiest place to add a function to be called for every request? Thanks, Alec -- You received this message because you are subscribed to the Google