On Tue, Jun 14, 2011 at 7:33 PM, Matt Bennett <m...@bennett.name> wrote:
> On Mon, Jun 13, 2011 at 9:53 PM, Vinay Sajip <vinay_sa...@yahoo.co.uk> wrote:
>> On Jun 10, 2:05 pm, Matt Bennett <m...@bennett.name> wrote:
>>
>>> Is there a reason the call to logger.error can't come before we return
>>> the technical_500_response when DEBUG=True? It seems to me that the
>>> debug level should be checked in each individual handler, rather than
>>> determining whether the error is passed to the logger at all.
>>
>> Aren't these two separate things? It makes sense to have the logging
>> of errors occur in all code paths, but that isn't connected with
>> levels on handlers. The first requires the logging call to be added to
>> the code, whereas levels on handlers can be configured to be as
>> verbose (or not) as you like, independently of logging calls in the
>> code.
>>
>
> I think we're saying the same thing - my point is that the logging of
> errors should occur in call code paths. Currently, an unhandled view
> error is *not* logged if settings.DEBUG is True. To be clear, this has
> nothing to do with the log levels on the handlers.

For the benefit of the archive: there is some method to the madness here :-)

The behavior that is implemented in the 500 handler is a bit
convoluted, but it was designed to be a drop-in replacement for the
behavior that existed in 1.2 -- i.e., server error emails were not
sent in DEBUG mode. I remember looking at this exact problem; as I
recall, I was faced with the option of filtering in the handler (which
would mean providing a email handler that wouldn't send emails under
certain circumstances) or filtering at the logging call level. In the
interest of making the admin email handler general purpose, I opted
for the second option.

Now, I'm not absolutely bound to this specific implementation, only to
the preservation of existing behavior without hobbling the email
handler as a general purpose tool.

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-developers@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.

Reply via email to