Created
July 25, 2019 12:03
-
-
Save iwanbolzern/85635dc228109b6387ba86e279c195b2 to your computer and use it in GitHub Desktop.
Simple logging configuration for python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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