Skip to content

Instantly share code, notes, and snippets.

@iwanbolzern
Created July 25, 2019 12:03
Show Gist options
  • Save iwanbolzern/85635dc228109b6387ba86e279c195b2 to your computer and use it in GitHub Desktop.
Save iwanbolzern/85635dc228109b6387ba86e279c195b2 to your computer and use it in GitHub Desktop.
Simple logging configuration for python
# setup logging
stdout_handler = logging.StreamHandler(stream=sys.stdout)
rotate_handler = RotatingFileHandler('../log/face-aggregator.log', maxBytes=2000, backupCount=10)
logging.basicConfig(level=logging.INFO,
format='[%(asctime)s] [%(levelname)s] %(message)s',
handlers=[stdout_handler, rotate_handler])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment