Add example of logging config file
See original GitHub issueIn the doc, there is the description of --log-config <path>
for the configuration of a config file. I think an example of config file could be really awesome for the new comers.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:83
- Comments:25 (9 by maintainers)
Top Results From Across the Web
logging.config — Logging configuration — Python 3.11.1 ...
The following functions configure the logging module. They are located in the logging.config module. Their use is optional — you can configure the...
Read more >file - How to use logging with python's fileConfig and configure ...
Try calling logging.config.dictConfig() after fileConfig() and just setting the filename.
Read more >Logger From Config File - Real Python
You can configure logging using the module and class functions or by creating a config file or a dictionary and loading it using...
Read more >logging.config - Simple Guide to Configure Loggers from ...
An in-depth guide to configure loggers from dictionary and config files. Python module "logging.config" provides us with various methods to ...
Read more >Config Files and Logging - Medium
Why writing the messages in a log file important? Any message outputted in ... An example of a config file is below. The...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Another solution I found, in order to use uvicorn formatter classes (and not lose colors, for instance), is to re-define loggers like this:
Not sure if this is helpful but I had the same issue as @mattiacampana and I solved by defining a new formatter, a new handler and configuring the root logger to use them. Then setting
disable_existing_loggers: False
allows existing uvicorn loggers to inherit the custom configuration without having to modify them at “runtime”: