From 7dd9156af4ed8f11663394d26bda54a4cb20a9fb Mon Sep 17 00:00:00 2001 From: "Antoine R. Dumont (@ardumont)" <ardumont@softwareheritage.org> Date: Wed, 14 Aug 2024 11:37:02 +0200 Subject: [PATCH] search: Allow gunicorn logging config to be effective Refs. swh/infra/sysadm-environment#5327 --- apps/swh-search/entrypoint.sh | 5 +++++ apps/swh-search/requirements.txt | 1 + 2 files changed, 6 insertions(+) diff --git a/apps/swh-search/entrypoint.sh b/apps/swh-search/entrypoint.sh index db2c4a1d4..6322315c0 100644 --- a/apps/swh-search/entrypoint.sh +++ b/apps/swh-search/entrypoint.sh @@ -17,9 +17,14 @@ case "$1" in exec swh $@ ;; *) + EXTRA_CLI_FLAGS="" + if [ ! -z "${SWH_LOG_CONFIG_JSON}" ]; then + EXTRA_CLI_FLAGS="--log-config-json ${SWH_LOG_CONFIG_JSON}" + fi echo Starting the swh-search API server exec gunicorn --bind 0.0.0.0:${PORT} \ --log-level ${SWH_LOG_LEVEL:-INFO} \ + ${EXTRA_CLI_FLAGS} \ --threads ${THREADS} \ --workers ${WORKERS} \ --timeout ${TIMEOUT} \ diff --git a/apps/swh-search/requirements.txt b/apps/swh-search/requirements.txt index b66204c5c..955897127 100644 --- a/apps/swh-search/requirements.txt +++ b/apps/swh-search/requirements.txt @@ -1 +1,2 @@ swh.search +python-json-logger -- GitLab