import logging logging.basicConfig(filename="sample.log", level=logging.INFO) log = logging.getLogger("ex") try: raise RuntimeError except Exception, err: log.exception("Error!")
You can find a good blog on Logging here:
http://www.blog.pythonlibrary.org/2012/08/02/python-101-an-intro-to-logging/
No comments:
Post a Comment