Open c-bata opened 8 years ago
Thanks for the link! I haven't done a whole lot with the logger module before.
Are you talking specifically about the Logger middleware class? I think I use getLogger for most of the logging in the project.
In your opinion, do do you think that a new log should be created for each incoming connection:
def __call__(self, req, res):
req.log = getLogger('req')
or as I have it now, where the Logger middleware attaches itself to the request, and is used as a proxy for the internal logger?
def __call__(self, req, res):
req.log = self
Also, I'm open for suggestions on best ways to format the log prefix, or at least allowing the user to chose the format.
I'll probably visit this after I figure out the event system, the goal being the ability to log the response status code and content size after being sent.
This project is interesting to me.
I think python's library should not use root logger like:
refs: http://pieces.openpolitics.com/2012/04/python-logging-best-practices/
Would you replace root logger like: