old_contents: import logging
  import logging.handlers
  
  # ######### Set up logging ##########
  # log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
  logger = logging.getLogger('bb_log')
  logger.setLevel(logging.DEBUG)
  
  # create file handler which logs even debug messages
  tfh = logging.handlers.TimedRotatingFileHandler('./logs/app.log', when='midnight', delay=False, encoding=None,
                                                  backupCount=5)
  tfh.setLevel(logging.DEBUG)
  
  # create console handler with a higher log level
  ch = logging.StreamHandler()
  ch.setLevel(logging.DEBUG)
  
  # create formatter and add it to the handlers
  formatterch = logging.Formatter('%(asctime)s %(levelname)s: %(message)s')
  formattertfh = logging.Formatter('%(asctime)s %(levelname)s: %(message)s - %(name)s')
  ch.setFormatter(formatterch)
  tfh.setFormatter(formattertfh)
  
  # add the handlers to logger
  logger.addHandler(ch)
  logger.addHandler(tfh)
new_contents: from logentries import LogentriesHandler
  import logging
  import logging.handlers
  
  
  # ######### Set up logging ##########
  # log.basicConfig(format="%(asctime)s - %(levelname)s: %(message)s", level=log.DEBUG)
  logger = logging.getLogger('bb_log')
  logger.setLevel(logging.DEBUG)
  
  # create file handler which logs even debug messages
  tfh = logging.handlers.TimedRotatingFileHandler('./logs/app.log', when='midnight', delay=False, encoding=None,
                                                  backupCount=5)
  tfh.setLevel(logging.DEBUG)
  
  # create console handler with a higher log level
  ch = logging.StreamHandler()
  ch.setLevel(logging.DEBUG)
  
  # create formatter and add it to the handlers
  formatterch = logging.Formatter('%(asctime)s %(levelname)s: %(message)s')
  formattertfh = logging.Formatter('%(asctime)s %(levelname)s: %(message)s - %(name)s')
  ch.setFormatter(formatterch)
  tfh.setFormatter(formattertfh)
  
  # add the handlers to logger
  logger.addHandler(ch)
  logger.addHandler(tfh)
  logger.addHandler(LogentriesHandler('261f2529-d09a-4088-a15b-5131cc711dc9'))
subject: Add Logentries logging handler