On Sun, Sep 26, 2010 at 8:45 PM, Florian Apolloner <f.apollo...@gmail.com> wrote: > Hi, > Another question that came into my mind, after reading > http://www.reddit.com/r/Python/comments/ddkal/django_vs_web2py_what_do_you_use_and_why/c0zmxqz > (actually the whole thread, but that's the relevant post): Is there an > easy and nice way to attach some extra info (eg request) to the > logging info? Especially since I can't pass the request down all way > to 3rd party apps; but I still want it to be logged in context of the > current request (for easier debugging etc). The example in the reddit > link isn't really convincing me -- especially since django doesn't put > the request and other info into threadlocals.
Yes, there is, and the logging calls I've included in the patch on #12012 make use of it. All the logging calls take an 'extra' parameter which can be used to insert relevant context into the logging call, and can be used in a custom formatter. In all the logging calls registering 4XX and 5XX messages, I've included the current request as extra context. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.