Skip to content

Instantly share code, notes, and snippets.

@blueset
Created August 31, 2019 04:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blueset/298aaa00788170a391579b212fea3999 to your computer and use it in GitHub Desktop.
Save blueset/298aaa00788170a391579b212fea3999 to your computer and use it in GitHub Desktop.
Rotational logger sample
# ...
logging:
version: 1
disable_existing_loggers: false
formatters:
sample:
format: '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
handlers:
rotation:
level: INFO
formatter: sample
class: logging.RotatingFileHandler
filename: /var/log/ehforwarderbot.default.log
maxBytes: 104857600 # 100 MiB
backupCount: 5
loggers:
'':
handlers: [rotation,]
level: DEBUG
propagate: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment