How can i let python write all errors to a spesific logfile?
<p>here is my code</p>

<pre><code>import sys
import logging
import traceback
import MySQLdb

def log_except_hook(*exc_info):
        text = "".join(traceback.format_exception(*exc_info))
        logging.error("Unhandled exception: %s", text)

sys.excepthook = log_except_hook

db = MySQLdb.connect("sdfgdfgsdgd.nl","1","1","1" )
cursor = db.cursor()
</code></pre>
