I have a webapp (Flask) and I need to enable some logging. I need to log to a mysql table with the columns:
id, timestamp, userid, orderid, service, msg, response
I would like to use the python's std logging. Example usage would be:
special_logger = logging.getSpecialLogger() # instead of logging.getLogger()
special_logger.setLevel(level=logging.DEBUG)
special_logger.addHandler(myMysqlHandler)
special_logger.debug(current_uid, myorderid, 'SERVICE1', 'Exception happened', serviceResponse)
How I can achieve that?