Skip to content

Instantly share code, notes, and snippets.

@keithrozario
Created April 30, 2020 10:48
Show Gist options
  • Save keithrozario/f967e1fbae6eccb6d80a17e48df886e5 to your computer and use it in GitHub Desktop.
Save keithrozario/f967e1fbae6eccb6d80a17e48df886e5 to your computer and use it in GitHub Desktop.
Change Logger Setting
logger = logging.getLogger()
logger.setLevel(logging.INFO)
logger.handlers[0].setFormatter(logging.Formatter('{"level": "%(levelname)s", "message": "%(message)s", "time": "%(asctime)s", "name": "%(name)s"}',
"%Y-%m-%dT%H:%M:%S"))
logger.info("Hello")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment