fix: wire LOGLEVEL into gunicorn logger level and RQ worker/scheduler

The gunicorn logging config hard-coded level=INFO, ignoring LOGLEVEL.
Patch it at startup via sed. Also pass --logging_level to rq worker
and rqscheduler so their framework logging respects LOGLEVEL.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Georges-Antoine Assi
2026-04-11 10:09:03 -04:00
parent af2d1f3471
commit 485b6af0dd
2 changed files with 6 additions and 2 deletions

View File

@@ -196,7 +196,8 @@ start_bin_rq_scheduler() {
RQ_REDIS_SSL=${REDIS_SSL:-0} \
rqscheduler \
--path /backend \
--pid /tmp/rq_scheduler.pid &
--pid /tmp/rq_scheduler.pid \
--logging_level "${LOGLEVEL}" &
}
# Commands to start RQ worker
@@ -219,6 +220,7 @@ start_bin_rq_worker() {
--pid /tmp/rq_worker.pid \
--url "${redis_url}" \
--results-ttl "${TASK_RESULT_TTL:-86400}" \
--logging_level "${LOGLEVEL}" \
high default low &
}

View File

@@ -52,7 +52,8 @@ RQ_REDIS_HOST=${REDIS_HOST:-127.0.0.1} \
RQ_REDIS_SSL=${REDIS_SSL:-0} \
rqscheduler \
--path /app/backend \
--pid /tmp/rq_scheduler.pid &
--pid /tmp/rq_scheduler.pid \
--logging_level "${LOGLEVEL:-INFO}" &
echo "Starting RQ worker..."
# Build Redis URL properly
@@ -69,6 +70,7 @@ PYTHONPATH="/app/backend:${PYTHONPATH-}" rq worker \
--path /app/backend \
--pid /tmp/rq_worker.pid \
--url "${REDIS_URL}" \
--logging_level "${LOGLEVEL:-INFO}" \
high default low &
echo "Starting watcher..."