From a0d0e07a764325f773e3303ea9a3db1a5ec49189 Mon Sep 17 00:00:00 2001 From: Radoslav Kirilov Date: Wed, 6 Nov 2024 17:33:19 +0200 Subject: [PATCH] fix(logger): unset `CORVA_LOGGER.propagate = False` for OTel Log Sending (refs EE-31) refs https://github.com/corva-ai/otel/pull/37 refs https://corvaqa.atlassian.net/browse/EE-31 --- CHANGELOG.md | 4 ++++ src/corva/logger.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa066643..7fa48d44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Unset the `CORVA_LOGGER.propagate = False`, so the OTel handler will be able to collect and send those logs as well + refs https://github.com/corva-ai/otel/pull/37 + ## [1.11.4] - 2024-02-08 diff --git a/src/corva/logger.py b/src/corva/logger.py index 87182a7b..32edd6d2 100644 --- a/src/corva/logger.py +++ b/src/corva/logger.py @@ -11,7 +11,11 @@ CORVA_LOGGER = logging.getLogger('corva') CORVA_LOGGER.setLevel(SETTINGS.LOG_LEVEL) -CORVA_LOGGER.propagate = False # do not pass messages to ancestor loggers + +# unset to pass messages to ancestor loggers, including OTel Log Sending handler +# see https://github.com/corva-ai/otel/pull/37 +# see https://corvaqa.atlassian.net/browse/EE-31 +# CORVA_LOGGER.propagate = False def get_formatter(