← All notes

Python logging.config: configure logging from a file or a dictionary

Answer: The following functions configure the logging module.

Configuration functions

Their use is optional.

You can configure the logging module using these functions, or from application code.

dictConfig takes the logging configuration from a dictionary.

Configuration dictionary schema describes the contents of that dictionary.

A propagate value which is not a boolean will raise an error.

File-based setup

fileConfig reads the logging configuration from a configparser-format file.

This function can be called several times from an application.

An end user can then select from various pre-canned configurations.

If an error is encountered during configuration, this function will raise.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, logging.config — Logging configuration; CPython, logging.config documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, logging.config — Logging configuration; CPython, logging.config documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation.

Cite this

Permanent ID: iil:note:wzvm91q1

iinventedlight. 2026. "Python logging.config: configure logging from a file or a dictionary." iinventedlight Library, iil:note:wzvm91q1, version of 2026-11-24. https://iinventedlight.com/library/notes/python-logging-config/. License: CC-BY-4.0.

@misc{iil_note_wzvm91q1,
  author = {{iinventedlight}},
  title = {{Python logging.config: configure logging from a file or a dictionary}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-24},
  url = {https://iinventedlight.com/library/notes/python-logging-config/},
  note = {Permanent ID iil:note:wzvm91q1. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/python-logging-config.md.