Python - Quick Start of Logging October 16, 2014 Reading time ~1 minute A very simple file logger: import logging logger = logging.getLogger(__name__) # this will show current module in the log line logger.setLevel(logging.INFO) # create a file handler handler = logging.FileHandler('hello.log') handler.setLevel(logging.INFO) # create a logging format formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') handler.setFormatter(formatter) # add the handlers to the logger logger.addHandler(handler) logger.info('Happy logging!') Logging in a catch try: open('/path/to/does/not/exist', 'rb') except (SystemExit, KeyboardInterrupt): raise except Exception, e: logger.error('Failed to open file', exc_info=True) Ref: [1] - Good logging practice in Python Read More Create external Hive table in JSON with partitions Most common usage in Hive Continue reading Check out Flink's fancy save point in your local machine Published on June 12, 2017 Test your Redux containers with Enzyme Published on May 22, 2017