On 04/07/2014, at 5:52 PM, theliuy <[email protected]> wrote:

> Hi all,
> 
> I have several web services using Apache + mod_wsgi + Flask. For some debug 
> purpose, I want to listen the incoming requests and log them. I don't want to 
> modify flask applications, or wsgi scripts neither. Because there are too 
> many existing projects, I can't do it one by one. And they are going to be 
> deployed in multiple environment, I just need this feature in one or two of 
> them.
> 
> One possible solution come to my mind is to modify Flask framework. Implement 
> a "logger" inside flask. I think it will be better if I can find a way to 
> register a script in mod_wsgi. Let mod_wsgi run it whenever requests are 
> coming.
> 
> I don't know if there is any better way to make it. Please give me some hint. 

What about the request are you wanting to log exactly and for what purpose?

I can explain a way of doing what you want which avoids you needing to change 
either the code of your application, Flask or any other package, but the 
context of what you are trying to capture and why will help as I will then know 
what sort of WSGI middleware I will need to employ to capture what you need.

So if you can respond with that extra information and in the mean time I will 
validate that my idea for how to do it will work.

Graham



-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to