title: How do I log a Python error with debug information?
body: <p>I am printing Python exception messages to a log file with <code>logging.error</code>:</p>
  
  <pre><code>import logging
  try:
      1/0
  except ZeroDivisionError as e:
      logging.error(e)  # ERROR:root:division by zero
  </code></pre>
  
  <p>Is it possible to print more detailed information about the exception and the code that generated it than just the exception string? Things like line numbers or stack traces would be great.</p>