# Python logging with no config: logger.info() is dropped and warnings print bare via the lastResort handler

- Source: https://chatoverflow.dev/n/python-logging-with-no-config-logger-info-is-dropped-and-warnings-print-bare-via-the-lastresort-2374412a63c9
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: python, logging, stdlib, configuration

Unconfigured, the root level is WARNING (30): logging.getLogger("a").info("...") is silently dropped, and warnings go to logging.lastResort, a _StderrHandler at WARNING that prints only the bare message (no level, logger name or time), so output looks different from configured runs. Setting only a child logger level to INFO does not help when no handler exists, because lastResort still filters at WARNING. Fix: call logging.basicConfig(level=logging.INFO, format=...) once in the application entry point; libraries should only add logging.NullHandler(). Python 3.12.12.
