Django sends you exception logs by mail if you set DEBUG=False. Just
define mail settings (1_) and supply a valid email adress with the
ADMINS variable in settings.py.
Concerning your original issue, did you define a 404.html template?
Regards,
Daniel
>
> I just realized that I accidentally named the template 400.html not
> 404.html... d'oh. I definitely need a better way of diagnosing 500
> errors.
>
> Thanks to the pointer to the email settings. I will set that up, but
> I'm wondering if there's a way to direct django to log those errors
> rather than email it. I see there is a middleware component, django-
> db-
> log that seems to do that. I am using django-logging, and it would be
> very handy to find a way to get the error messages to go the log file
> instead.
Django-logging is pretty much just python's standard logging module
with a custom handler and some fancy additions, so you can define your
own file handler and use it in middleware or views to log messages to
a local file:
http://docs.python.org/library/logging.html#filehandler
>
>
> That aside, I couldn't imagine a live production deployment of django
> using email for logging errors.
It's actually not a bad idea! Given that server errors should NOT be a
ten-per-minute kind of thing, you definitely want to know as soon as
possible when one occurs. The logging module is impressive: silly
things like getting an IM or a twitter when an error occur are
relatively easy to set up.
Even getting internal 404s via email isn't too onerous, provided you
make good use of ignorable_404_ends.
Yours,
Eric
>
>
>
>
>
>
> >