Jump to solution
Verify

The Fix

Upgrade to version 0.19.0 or later.

Based on closed Kludex/uvicorn issue #1285 · PR/commit linked

Production note: This usually shows up under retries/timeouts. Treat it as a side-effect risk until you can verify behavior with a canary + real traffic.

Jump to Verify Open PR/Commit
@@ -15,6 +15,17 @@ from uvicorn.config import LOGGING_CONFIG +# Note: We explicitly turn the propagate on just for tests, because pytest +# caplog not able to capture no-propagate loggers. +#
repro.py
import logging from fastapi import FastAPI logging.basicConfig(level=logging.INFO) app = FastAPI(debug=True)
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Upgrade to fixed release\nUpgrade to version 0.19.0 or later.\nWhen NOT to use: This fix is not suitable if you require log propagation for ancestor loggers.\n\nOption C — Workaround\nin the meantime?\nWhen NOT to use: This fix is not suitable if you require log propagation for ancestor loggers.\n\n

Why This Fix Works in Production

  • Trigger: Duplicate logs when use logging.basicConfig in application
  • Mechanism: Sets the 'propagate' attribute to 'False' on the 'uvicorn' logger to prevent duplicate logs when using logging.basicConfig.
  • Why the fix works: Sets the 'propagate' attribute to 'False' on the 'uvicorn' logger to prevent duplicate logs when using logging.basicConfig. (first fixed release: 0.19.0).
Production impact:
  • If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.

Why This Breaks in Prod

  • Shows up under Python 3.9.7 in real deployments (not just unit tests).
  • Production symptom (often without a traceback): Duplicate logs when use logging.basicConfig in application

Proof / Evidence

  • GitHub issue: #1285
  • Fix PR: https://github.com/kludex/uvicorn/pull/1288
  • First fixed release: 0.19.0
  • Reproduced locally: No (not executed)
  • Last verified: 2026-02-09
  • Confidence: 0.75
  • Did this fix it?: Yes (upstream fix exists)
  • Own content ratio: 0.69

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“Any Update on this one? It's really annoying :(”
@yuval-illumex · 2022-07-05 · source
“- This was closed by #1288. It will be available on uvicorn version 0.19.0.”
@Kludex · 2022-10-08 · source
“yes sounds sensible, fancy throwing a PR @guyskk ?”
@euri10 · 2021-12-08 · source
“@euri10 👌 here is the PR: https://github.com/encode/uvicorn/pull/1288”
@guyskk · 2021-12-09 · source

Failure Signature (Search String)

  • Duplicate logs when use logging.basicConfig in application
  • When use logging.basicConfig to config logging in application, uvicorn logs will duplicate in console.
Copy-friendly signature
signature.txt
Failure Signature ----------------- Duplicate logs when use logging.basicConfig in application When use logging.basicConfig to config logging in application, uvicorn logs will duplicate in console.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- Duplicate logs when use logging.basicConfig in application When use logging.basicConfig to config logging in application, uvicorn logs will duplicate in console.

Minimal Reproduction

repro.py
import logging from fastapi import FastAPI logging.basicConfig(level=logging.INFO) app = FastAPI(debug=True)

Environment

  • Python: 3.9.7

What Broke

Duplicate log entries appear in the console, leading to confusion during application monitoring.

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

Upgrade to version 0.19.0 or later.

When NOT to use: This fix is not suitable if you require log propagation for ancestor loggers.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Option C — Workaround Temporary workaround

in the meantime?

When NOT to use: This fix is not suitable if you require log propagation for ancestor loggers.

Use only if you cannot change versions today. Treat this as a stopgap and remove once upgraded.

Fix reference: https://github.com/kludex/uvicorn/pull/1288

First fixed release: 0.19.0

Last verified: 2026-02-09. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix is not suitable if you require log propagation for ancestor loggers.

Verify Fix

verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.

Did This Fix Work in Your Case?

Quick signal helps us prioritize which fixes to verify and improve.

Prevention

  • Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
  • Pin production dependencies and upgrade only with a reproducible test that hits the failing path.

Version Compatibility Table

VersionStatus
0.19.0 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.