Save error logs

Bug #645229 reported by Stas Shtin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
WikiPBX
New
Undecided
Dreamtime

Bug Description

Since we tell the user on error 500 page that his error has been reported, it makes sense to actually reporti it :-)

This can be done by adding an error handling view as described in http://docs.djangoproject.com/en/dev/topics/http/views/#the-500-server-error-view . It should simply create a new ServerLog instance with error traceback.

Also, we should probably clean ServerLogs older than a configurable amout of days (something like 2 weeks by default) in admin's server logs list page.

Stas Shtin (stas.shtin)
Changed in wikipbx:
assignee: nobody → Dreamtime (dmm)
Revision history for this message
Dreamtime (dmm) wrote :

Such errors being reported via email when we uncomment ADMIN in settings.py:

ADMINS = (
    # ('Your Name', '<email address hidden>'),
)

I'm not sure that logging to DB will work in this case, course who knows what kind of error happened -
may be DB server went down, or we have syntax error in our scripts.

As for limiting amount of logs, thats a good feature. I'll get back to it later.

Also I saw your addition of translation for 500 page in ~wikipbx-dev/wikipbx/trunk : 191.
According Django docs they recommend this page to be as light as possible:
http://www.djangobook.com/en/2.0/chapter12/
May be we should avoid translation in this case?

Changed in wikipbx:
status: New → Opinion
status: Opinion → New
Revision history for this message
Stas Shtin (stas.shtin) wrote :

Sure, we can't store an error message in DB if it was caused by DB failure. But email is probably even less reliable and there's no guarantees that user even had entered his email address in the settings. So we need both.

Perhapse error messages should be sent to server log from logger's error method as well. Maybe it should delete excessive error messages after writing to DB as well, to preven storing lots of useless info in the database.

As for removing i18n from error page - it's not a good idea to do that, because there's practically no chance that this page would fail because of translation tag. At the same time, it would be rather confusing for people who don't speak english. As it's just advice in the book rather than official documentation, there's no need to follow it.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.