title: Logging uncaught exceptions in Python
body: <p>How do you cause uncaught exceptions to output via the <code>logging</code> module rather than to <code>stderr</code>?</p>
  
  <p>I realize the best way to do this would be:</p>
  
  <pre><code>try:
      raise Exception, 'Throwing a boring exception'
  except Exception, e:
      logging.exception(e)
  </code></pre>
  
  <p>But my situation is such that it would be <em>really nice</em> if <code>logging.exception(...)</code> were invoked automatically whenever an exception isn't caught.</p>