Skip to content

Instantly share code, notes, and snippets.

@mmasztalerczuk
Created June 6, 2016 20:27
Show Gist options
  • Save mmasztalerczuk/d4ffb83973c205243a5e2111b7c74b79 to your computer and use it in GitHub Desktop.
Save mmasztalerczuk/d4ffb83973c205243a5e2111b7c74b79 to your computer and use it in GitHub Desktop.
{
"version": 1,
"formatters": {
"default": {
"format": "default %(asctime)s %(levelname)s %(message)s"
},
"forA": {
"format": "forA %(asctime)s %(levelname)s %(message)s"
},
"forB": {
"format": "forB %(asctime)s %(levelname)s %(message)s"
}
},
"handlers": {
"info_file_handler": {
"class": "logging.handlers.RotatingFileHandler",
"level": "INFO",
"formatter": "default",
"filename": "info.log",
"maxBytes": 10485760,
"backupCount": 20,
"encoding": "utf8"
},
"forA": {
"class": "logging.handlers.RotatingFileHandler",
"level": "INFO",
"formatter": "forA",
"filename": "info.log",
"maxBytes": 10485760,
"backupCount": 20,
"encoding": "utf8"
},
"forB": {
"class": "logging.handlers.RotatingFileHandler",
"level": "INFO",
"formatter": "forB",
"filename": "info.log",
"maxBytes": 10485760,
"backupCount": 20,
"encoding": "utf8"
}
},
"loggers": {
"__main__": {
"level": "INFO",
"handlers": ["info_file_handler"],
"propagate": false
},
"__main__.A": {
"level": "INFO",
"handlers": ["forA"],
"propagate": false
},
"__main__.B": {
"level": "INFO",
"handlers": ["forB"],
"propagate": false
}
},
"root": {
"level": "INFO"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment