I'd like to use dictConfig, but the documentation is a little bit abstract. Where can I find a concrete, copy+paste-able example of the dictionary used with dictConfig
?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
The accepted answer is nice! But what if one could begin with something less complex? The logging module is very powerful thing and the documentation is kind of a little bit overwhelming especially for novice. But for the beginning you no need to configure formatters and handlers. You can add it when you figure out what you want.
For example:
How about here!
Usage:
In case you see too many logs from third-party packages, feel free to unlist the root logger in the config to suppress those messages.
Example with Stream Handler, File Handler, Rotating File Handler and SMTP Handler
I found Django v1.11.15 default config below, hope it helps