1.3 KiB
1.3 KiB
Python Logging Source References
Use these official Python docs when applying the Python logging skill.
Core Documentation
!!! info "Core documentation" - Logging HOWTO - Logging Cookbook - logging API reference - logging.config reference
Configuration And dictConfig
!!! info "dictConfig references"
- Dictionary schema details for version, formatters, handlers, loggers, and root.
- logging.config.dictConfig function reference.
Practical Notes
- Prefer module loggers created with
logging.getLogger(__name__). - Let applications configure handlers and formatters; libraries should emit logs without taking over routing.
- Use
basicConfigfor simple scripts anddictConfigfor centralized application configuration. - Explicitly set
disable_existing_loggers: FalseindictConfigunless disabling existing non-root loggers is intentional. - Use queue-based handlers when slow handlers would block async, threaded, or high-volume code paths.