From 5b9ca7240687b9d4db5a9aecc4f2a2c08f073e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baki=20Burak=20=C3=96=C4=9F=C3=BCn?= <63836730+bakiburakogun@users.noreply.github.com> Date: Sat, 29 Aug 2026 08:30:56 +0300 Subject: [PATCH] fix(logging): let debug: true reach stderr, not only the log file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The stderr handler is pinned at WARNING in logger_config.yaml, so with debug: true the detail is written to persistent_storage/logs/ccb.log but docker logs stays nearly silent. The k8s config already has stderr at DEBUG. Everything that describes what indexing is doing is INFO or DEBUG, so from outside the container a healthy-but-slow run and a stuck one look the same: the only thing that surfaces is the occasional ERROR traceback, without the context around it. Lower the stderr handler along with the logger levels when debug is on, so turning debug on makes the logs visible where a container deployment reads them. Reading the app config a few lines earlier is what makes that possible. Fixes #347 Signed-off-by: Baki Burak Öğün <63836730+bakiburakogun@users.noreply.github.com> --- main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 8fd5c6a..7b6f7f7 100755 --- a/main.py +++ b/main.py @@ -49,9 +49,15 @@ def _setup_log_levels(debug: bool): if __name__ == '__main__': k8s_env = is_k8s_env() + app_config: TConfig = app.extra['CONFIG'] logging_config = get_logging_config(LOGGER_K8S_CONFIG_NAME if k8s_env else LOGGER_CONFIG_NAME) + if app_config.debug: + # the file handler is already at DEBUG; without this the detail never reaches + # stderr, which is where a container deployment is read from + stderr_handler = logging_config.get('handlers', {}).get('stderr') + if stderr_handler is not None: + stderr_handler['level'] = 'DEBUG' setup_logging(logging_config) - app_config: TConfig = app.extra['CONFIG'] _setup_log_levels(app_config.debug) # do forks from a clean process that doesn't have any threads or locks