Skip to content

Instantly share code, notes, and snippets.

@ahyt910
Created April 16, 2019 07:37
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 ahyt910/4252d26a4c244e84556ca2a1fd1287a0 to your computer and use it in GitHub Desktop.
Save ahyt910/4252d26a4c244e84556ca2a1fd1287a0 to your computer and use it in GitHub Desktop.
{
"version": 1,
"disable_existing_loggers": false,
"root": {
"level": "DEBUG",
"handlers": [
"consoleHandler",
"logFileHandler"
]
},
"handlers": {
"consoleHandler": {
"class": "logging.StreamHandler",
"level": "INFO",
"formatter": "consoleFormatter",
"stream": "ext://sys.stdout"
},
"logFileHandler": {
"class": "logging.FileHandler",
"level": "DEBUG",
"formatter": "logFileFormatter",
"filename": "./log/app.log",
"mode": "w",
"encoding": "utf-8"
}
},
"formatters": {
"consoleFormatter": {
"format": "[%(levelname)-8s]%(funcName)s - %(message)s"
},
"logFileFormatter": {
"format": "%(asctime)s|%(levelname)-8s|%(name)s|%(funcName)s|%(message)s"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment