title: Log all errors to console or file on Django site
body: <p>How can I get Django 1.0 to write <b>all</b> errors to the console or a log file when running runserver in debug mode?  </p>
  
  <p>I've tried using a middleware class with process_exception function as described in the accepted answer to this question:</p>
  
  <p><a href="https://stackoverflow.com/questions/238081/how-do-you-log-server-errors-on-django-sites">How do you log server errors on django sites</a></p>
  
  <p>The process_exception function is called for some exceptions (eg: assert(False) in views.py) but process_exception is not getting called for other errors like ImportErrors (eg: import thisclassdoesnotexist in urs.py).  I'm new to Django/Python.  Is this because of some distinction between run-time and compile-time errors?  But then I would expect runserver to complain if it was a compile-time error and it doesn't.</p>
  
  <p>I've watched Simon Willison's fantastic presentation on Django debugging (<a href="http://simonwillison.net/2008/May/22/debugging/" rel="nofollow noreferrer">http://simonwillison.net/2008/May/22/debugging/</a>) but I didn't see an option that would work well for me.</p>
  
  <p>In case it's relevant, I'm writing a Facebook app and Facebook masks HTTP 500 errors with their own message rather than showing Django's awesomely informative 500 page.  So I need a way for <b>all</b> types of errors to be written to the console or file.</p>
  
  <p><b>Edit:</b> I guess my expectation is that if Django can return a 500 error page with lots of detail when I have a bad import (ImportError) in urls.py, it should be able to write the same detail to the console or a file without having to add any additional exception handling to the code.  I've never seen exception handling around import statements.</p>
  
  <p>Thanks,
  Jeff</p>