diff --git a/poetry.lock b/poetry.lock index 1a62177e2..bf875e8fa 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1602,11 +1602,8 @@ files = [ {file = "lxml-5.4.0-cp36-cp36m-win_amd64.whl", hash = "sha256:7ce1a171ec325192c6a636b64c94418e71a1964f56d002cc28122fceff0b6121"}, {file = "lxml-5.4.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:795f61bcaf8770e1b37eec24edf9771b307df3af74d1d6f27d812e15a9ff3872"}, {file = "lxml-5.4.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:29f451a4b614a7b5b6c2e043d7b64a15bd8304d7e767055e8ab68387a8cacf4e"}, - {file = "lxml-5.4.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:891f7f991a68d20c75cb13c5c9142b2a3f9eb161f1f12a9489c82172d1f133c0"}, {file = "lxml-5.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4aa412a82e460571fad592d0f93ce9935a20090029ba08eca05c614f99b0cc92"}, - {file = "lxml-5.4.0-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:ac7ba71f9561cd7d7b55e1ea5511543c0282e2b6450f122672a2694621d63b7e"}, {file = "lxml-5.4.0-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:c5d32f5284012deaccd37da1e2cd42f081feaa76981f0eaa474351b68df813c5"}, - {file = "lxml-5.4.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:ce31158630a6ac85bddd6b830cffd46085ff90498b397bd0a259f59d27a12188"}, {file = "lxml-5.4.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:31e63621e073e04697c1b2d23fcb89991790eef370ec37ce4d5d469f40924ed6"}, {file = "lxml-5.4.0-cp37-cp37m-win32.whl", hash = "sha256:be2ba4c3c5b7900246a8f866580700ef0d538f2ca32535e991027bdaba944063"}, {file = "lxml-5.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:09846782b1ef650b321484ad429217f5154da4d6e786636c38e434fa32e94e49"}, @@ -2812,14 +2809,14 @@ cli = ["click (>=5.0)"] [[package]] name = "python-json-logger" -version = "3.3.0" +version = "4.0.0" description = "JSON Log Formatter for the Python Logging Package" optional = false python-versions = ">=3.8" groups = ["main"] files = [ - {file = "python_json_logger-3.3.0-py3-none-any.whl", hash = "sha256:dd980fae8cffb24c13caf6e158d3d61c0d6d22342f932cb6e9deedab3d35eec7"}, - {file = "python_json_logger-3.3.0.tar.gz", hash = "sha256:12b7e74b17775e7d565129296105bbe3910842d9d0eb083fc83a6a617aa8df84"}, + {file = "python_json_logger-4.0.0-py3-none-any.whl", hash = "sha256:af09c9daf6a813aa4cc7180395f50f2a9e5fa056034c9953aec92e381c5ba1e2"}, + {file = "python_json_logger-4.0.0.tar.gz", hash = "sha256:f58e68eb46e1faed27e0f574a55a0455eecd7b8a5b88b85a784519ba3cff047f"}, ] [package.extras] @@ -3677,4 +3674,4 @@ propcache = ">=0.2.1" [metadata] lock-version = "2.1" python-versions = "^3.13" -content-hash = "9be7f1061bdce5467dc4925acf8f7dc815ae5afb20e65f93e623c10d3626da0e" +content-hash = "a227d46eea2dfc2deb9d365385b489929b86bcea6cc45fefd9500f2afb8599d9" diff --git a/pyproject.toml b/pyproject.toml index 53ae3bc2c..5613c25ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ asgiref = "^3.11.0" eval-type-backport = "^0.2.2" mangum = "^0.19.0" wireup = "^2.1.0" -python-json-logger = "^3.3.0" +python-json-logger = "^4.0.0" python-dateutil = "^2.9.0" pyhamcrest = "^2.1.0" boto3 = "^1.40.57" diff --git a/src/eligibility_signposting_api/logging/logs_manager.py b/src/eligibility_signposting_api/logging/logs_manager.py index 6ca253ef2..d83873d6f 100644 --- a/src/eligibility_signposting_api/logging/logs_manager.py +++ b/src/eligibility_signposting_api/logging/logs_manager.py @@ -30,9 +30,9 @@ def wrapper(event: LambdaEvent, context: LambdaContext) -> dict[str, Any] | None class EnrichedJsonFormatter(JsonFormatter): - def add_fields(self, log_record: dict[str, Any], record: logging.LogRecord, message_dict: dict[str, Any]) -> None: - log_record["request_id"] = request_id_context_var.get() or "-" - super().add_fields(log_record, record, message_dict) + def add_fields(self, log_data: dict[str, Any], record: logging.LogRecord, message_dict: dict[str, Any]) -> None: + log_data["request_id"] = request_id_context_var.get() or "-" + super().add_fields(log_data, record, message_dict) def init_logging(quieten: Sequence[str] = ("asyncio", "botocore", "boto3", "mangum", "urllib3")) -> None: