2017-08-27T08:56:34
Here's how I set up logging where:
- Log files rotate nightly (at midnight).
- We keep 10 total log files (as history).
import logging import os # Set up logging logger = logging.getLogger(__file__) handler_kwargs = { 'filename': os.path.join(base_dir, 'file.log'), 'when': 'midnight', 'backupCount': 10 } handler …