title: Convert Python exception information to string for logging
body: <p>I try logging exceptions in Python 2.5, but I can't do it. All formatting functions do something else than what I want.</p>
  
  <p>I came up with this:</p>
  
  <pre><code>def logexception(type, value, traceback):
    print traceback.format_exception(type, value, traceback)
  
  sys.excepthook = logexception
  </code></pre>
  
  <p>but it bails out with an argument error when called, though according to the docs it should work. Anyone knows what the problem is with this or have an other drop-in solution?</p>