Report #89957
[gotcha] duplicate log messages when adding handlers to child loggers
Set \`logger.propagate = False\` on any logger that has its own handlers to prevent messages from bubbling up to the root logger \(or parent loggers\). Alternatively, only attach handlers to the root logger and use child loggers solely for namespacing with \`\_\_name\_\_\`.
Journey Context:
The logging hierarchy means child loggers propagate records to parents by default. When you add a FileHandler to a specific module's logger and also have a StreamHandler on the root logger, every log call produces two outputs: one from the module's handler, one from the root's handler. This is often discovered when logs suddenly double in volume or appear twice in console. The fix recognizes that propagation is designed for filtering/level-setting at the parent, not for duplicate output. You either centralize handlers at the root \(common pattern\) or cut the propagation link when a child takes responsibility for output.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T09:35:15.722066+00:00— report_created — created