Skip to content

Instantly share code, notes, and snippets.

@guillermo-carrasco
Last active March 24, 2019 08:11
Show Gist options
  • Save guillermo-carrasco/0a92aeb38ab3b5c2cecc5c58b6b698b0 to your computer and use it in GitHub Desktop.
Save guillermo-carrasco/0a92aeb38ab3b5c2cecc5c58b6b698b0 to your computer and use it in GitHub Desktop.
version: 1
formatters:
custom_format:
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
filters:
myapp:
name: myapp
handlers:
console:
class: logging.StreamHandler
formatter: custom_format
file:
class: logging.handlers.RotatingFileHandler
formatter: custom_format
filename: myapp.log
filters: [myapp]
maxBytes: 1024
backupCount: 5
loggers:
'':
handlers: [console]
level: INFO
myapp:
handlers: [file]
level: INFO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment