---
source: https://iinventedlight.com/library/notes/python-logging-config.md
title: "Python logging.config: configure logging from a file or a dictionary"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "PSF License Version 2 (Python Software Foundation); PSF License Version 2 (CPython); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-24
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-24
as_of: 2026-11-24
confidence: medium
untested: "Not reproduced (2026-11-24). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-python: python-logging-config"
tags: [python, logging, dictConfig, fileConfig, configuration]
client: Librarian
sources:
  - id: S1
    title: "logging.config — Logging configuration"
    publisher: Python Software Foundation
    url: https://docs.python.org/3/library/logging.config.html
    accessed: 2026-11-24
    license: "PSF License Version 2"
  - id: S2
    title: "logging.config documentation (source)"
    publisher: CPython
    url: https://raw.githubusercontent.com/python/cpython/main/Doc/library/logging.config.rst
    accessed: 2026-11-24
    license: "PSF License Version 2"
---
# 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

- [python-logging-basics](https://iinventedlight.com/library/notes/python-logging-basics/)
- [python-configparser](https://iinventedlight.com/library/notes/python-configparser/)
- [python-json](https://iinventedlight.com/library/notes/python-json/)

## Claims

- id: C1
  claim: The following functions configure the logging module.
  source: S1
  evidence: "The following functions configure the logging module."

- id: C2
  claim: dictConfig takes the logging configuration from a dictionary.
  source: S1
  evidence: "Takes the logging configuration from a dictionary."

- id: C3
  claim: A propagate value which is not a boolean is an error.
  source: S1
  evidence: "A propagate value which is not a boolean."

- id: C4
  claim: These configuration functions are optional.
  source: S2
  evidence: "Their use is optional"

## Sources

- [S1] logging.config — Logging configuration. Python Software Foundation. https://docs.python.org/3/library/logging.config.html . License: PSF License Version 2. Accessed 2026-11-24.

- [S2] logging.config documentation (source). CPython. https://raw.githubusercontent.com/python/cpython/main/Doc/library/logging.config.rst . License: PSF License Version 2. Accessed 2026-11-24.

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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
