|
I'm running SVN trunk at the moment, and observing that when an error occurs (e.g. when there's a template error, or a search fails due to misconfiguration) there are no errors in the logs (either the django.osqa.log or the Apache error_log. I've modified settings_local.py and bumped the log level to logging.DEBUG, but I'm not seeing any more information. I know that logging is working, because I was seeing errors generated by the error page about missing CONTACT_URL settings (which is now resolved). Is there any logging when there are errors, and if they're meant to be in django.osqa.log how do I go about finding why they're not being logged? |
|
I've tried to get errors logged in the Apache logs with LogLevel info, but haven't had any success. Things like broken templates etc. just aren't logged. I only get errors in that log for core modules (i.e. stuff like the openid etc. - nothing from the forum app). Installing a top level error handler in the Django middleware stack seems to work well though - all errors are logged into django.osqa.log. Perhaps someone with more Python/Django experience could comment on whether this is the best way to go. What I did was the following... In settings.py:
In forum/middleware/log_errors.py (new file):
Well that's a perfectly valid way to handle them. But I think that misses lot of the request life cycle (stuff executed by django itself). Anyway, you can try setting this http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#admins> to get email notifications when stuff happens.
(19 Jul '10, 06:07)
Hernani Cerq... ♦♦
|
|
I've discovered the Django DEBUG=True option, which gives me really big error pages with lots of information. It's probably sufficient if I can't find anything else. |
|
The only errors logged in django.osqa.log are the error that can be predicted, I mean, the ones that we can circumvent or at least show some nicer error message. The ones that we do not have catch blocks for them are suposed to be logged in the apache error log. If you don't see them try checking the the log level parameter vhost file. Thanks for clarifying!
(16 Jul '10, 20:31)
Andrew
hmm is it possible to get them also in the django.osqa.log, not just apache log? I always assumed the intention of that file was to log every important event.
(19 Jul '10, 02:00)
Joseph
Well, if those errors are not expected it's difficult to trap them unless we become paranoid and wrap everything in try/except clauses. And even that way is not always possible, because there's a fair amount of code that is out of our control, django stuff. Those errors are the exception and should not occur. if you're looking for a way to be warned of all the 500 that occur try setting this http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#admins.
(19 Jul '10, 06:01)
Hernani Cerq... ♦♦
|