Python Logging Source References¶
Use these official Python docs when applying the Python logging skill.
Core Documentation¶
Core documentation
Configuration And dictConfig¶
dictConfig references
- Dictionary schema details for
version, formatters, handlers, loggers, and root. logging.config.dictConfigfunction 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.