title: With DEBUG=False, how can I log django exceptions to a log file
body: <p>With DEBUG=True, Django exceptions dump to stderr, which is typically sent to a rotating log file by the web server.</p>
  
  <p>With DEBUG=False, Django instead emails the exception to the the ADMINS=.</p>
  
  <p>How can I retain the DEBUG=True behavior with DEBUG=False?</p>
  
  <p>I've read <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> and <a href="https://stackoverflow.com/questions/2125080/how-can-i-see-error-logs-of-django-views">How can I see error logs of Django views</a> and <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>. The answer seems to involve some middleware.  Is there a code snippet available, or are these batteries included?</p>