Skip to content

Instantly share code, notes, and snippets.

@robobe
Created July 31, 2019 17:46
Show Gist options
  • Save robobe/8a69bfb7a2444e1ce3d592c609b314b5 to your computer and use it in GitHub Desktop.
Save robobe/8a69bfb7a2444e1ce3d592c609b314b5 to your computer and use it in GitHub Desktop.
Python logging json config file #python #config
{
"logging": {
"version": 1,
"disable_existing_loggers": true,
"formatters": {
"single-line": {
"class": "logging.Formatter",
"style": "{",
"datefmt": "%I:%M:%S",
"format": "{levelname:8s}; {asctime:s}; {name:<15s} {lineno:4d}; {message:s}"
}
},
"handlers": {
"console": {
"level": "DEBUG",
"class": "logging.StreamHandler",
"formatter": "single-line",
"stream": "ext://sys.stdout"
}
},
"loggers": {
"main": {
"level": "DEBUG",
"handlers": ["console"],
"propagate": false
}
},
"root": {
"level": "INFO",
"handlers": ["console"]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment