On Wed, Oct 6, 2010 at 9:23 PM, Vinay Sajip <[email protected]> wrote:
>
> On Oct 6, 11:53 am, Russell Keith-Magee <[email protected]>
> wrote:
>> On Wed, Oct 6, 2010 at 6:46 PM, Luke Plant <[email protected]> wrote:
>> > On Wed, 2010-10-06 at 12:24 +0800, Russell Keith-Magee wrote:
>
> There are other possibilities. For example, you could use a Filter to
> add contextual information to the log, as in this example:
>
> http://docs.python.org/dev/library/logging.html#using-filters-to-impart-contextual-information
>
> Filters can be added to loggers, but they only operate on the logger
> they're attached to, and not ancestor loggers. So they might need to
> be added to several Django loggers, not just the 'django' logger.

I considered that. The problem I hit is that in order for a filter to
operate, you still have to have access to the data your want to
annotate onto the record. As the patch I've provided demonstrates, we
can get access to the current request out of the top stack frame, but
other details such as the CSRF error condition aren't in a context
where we can access them (at least, I can't see a way, other than
threadlocals ;-)

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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to