From 3b5d1bdb1e07d62ae85bbbaf08d5243f68566e96 Mon Sep 17 00:00:00 2001 From: suppagoddo Date: Sun, 22 Nov 2026 16:14:27 -0800 Subject: [PATCH 1/2] docs(release): clarify 1.7.0 upgrade guidance and AsyncApp limitations --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8184563..5f4d14d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). - Default output is unchanged except where listed above: a `stack_info` field appears only for records logged with `stack_info=True`, an empty correlation header now yields the next header or a generated ID instead of `-`, and pre-existing root logger handlers emit JSON after `init_*()` (#147). +- **Upgrade guidance for existing log pipelines (#147):** With JSON enabled, root logger handlers attached before + `init_*()` are reformatted as JSON. Applications that require a plain-text root handler can attach it after + initialization. Unhandled Flask exceptions are now emitted as a single JSON record with `level` and `exc_info`, + rather than a plain-text multi-line traceback. Review log parsers and alerts that rely on the previous format. - The Connexion AsyncApp middleware lives in its own module and is only imported when Connexion 3 is installed, so `import json_logging` is unaffected for everyone else. (#159) - `read_request_body` needs Starlette 0.28 or newer. Connexion 2's `AioHttpApp` is not supported; Connexion 3's @@ -67,6 +71,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). - CI runs the unit tests on Python 3.9 to 3.14 and the Flask, Quart, FastAPI and Sanic smoke tests on Python 3.9 and 3.14. Python 3.8 and earlier, including Python 2, are not tested. +### Known limitations — Connexion 3 `AsyncApp` + +- **Background-task failures:** The ASGI request log is currently emitted after the application call returns. If a + background task raises after the response has been sent, the request log may be missing, even if the client + received a successful response. This was reproduced in-process with Connexion 3.3.0, but not on a live Uvicorn + server. +- **Response-time measurement:** `response_time_ms` currently includes background-task execution time, which may + overstate the time taken to send the HTTP response to the client. +- **Uvicorn access logging:** Initializing request instrumentation for `AsyncApp` disables the `uvicorn.access` + logger process-wide. Applications that also depend on Uvicorn access logging should account for this behavior. + ## 1.6.0 - 2026-10-21 ### Added From 6b22ec6144dab9475a0b67ec8910c845241dd23f Mon Sep 17 00:00:00 2001 From: suppagoddo Date: Sun, 22 Nov 2026 16:23:58 -0800 Subject: [PATCH 2/2] docs(release): clarify plain-text formatter and exception behavior --- CHANGELOG.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f4d14d..4c776e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,11 +23,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Changed -- Unhandled exceptions from Flask and Connexion apps are emitted as one JSON record with `level` and `exc_info` - instead of a plain multi-line traceback. `init_*()` now converts handlers already attached to the root logger, and - `init_request_instrument(app)` for Flask and Connexion converts `flask.logging.default_handler`. Applications that - attach a root handler with their own formatter before `init_*()` will see that handler emit JSON as well when JSON - logging is enabled. `config_root_logger()` is still needed for handlers added after initialisation. (#147) +- With JSON logging enabled, unhandled exceptions from Flask and Connexion apps are emitted as a JSON record + with `level` and `exc_info` when their handlers use JSON formatting, instead of the default plain multi-line + traceback. An explicitly plain-text handler can still emit a multi-line traceback. `init_*()` now converts + handlers already attached to the root logger, and `init_request_instrument(app)` for Flask and Connexion converts + `flask.logging.default_handler`. Applications that attach a root handler with their own formatter before `init_*()` + will see that handler emit JSON as well when JSON logging is enabled. `config_root_logger()` is still needed for + handlers added after initialisation. (#147) ### Fixed @@ -61,9 +63,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). `stack_info=True`, an empty correlation header now yields the next header or a generated ID instead of `-`, and pre-existing root logger handlers emit JSON after `init_*()` (#147). - **Upgrade guidance for existing log pipelines (#147):** With JSON enabled, root logger handlers attached before - `init_*()` are reformatted as JSON. Applications that require a plain-text root handler can attach it after - initialization. Unhandled Flask exceptions are now emitted as a single JSON record with `level` and `exc_info`, - rather than a plain-text multi-line traceback. Review log parsers and alerts that rely on the previous format. + `init_*()` are reformatted as JSON. To preserve a plain-text root handler, attach it after initialization with an + **explicit plain-text `logging.Formatter`**; a new handler without a formatter still uses the library's JSON default. + Unhandled Flask exceptions emit structured JSON with `level` and `exc_info` when their active handlers use JSON + formatting. An explicitly plain-text handler can still emit a multi-line traceback. Review log parsers and alerts + that depend on either format. - The Connexion AsyncApp middleware lives in its own module and is only imported when Connexion 3 is installed, so `import json_logging` is unaffected for everyone else. (#159) - `read_request_body` needs Starlette 0.28 or newer. Connexion 2's `AioHttpApp` is not supported; Connexion 3's