changes from bot review

This commit is contained in:
Georges-Antoine Assi
2026-04-11 09:58:32 -04:00
parent bc9961cfe5
commit af2d1f3471
4 changed files with 14 additions and 3 deletions

View File

@@ -46,6 +46,11 @@ LOGGING_CONFIG = {
"handlers": ["default"],
"propagate": False,
},
"uvicorn.access": {
"level": LOGLEVEL,
"handlers": ["default"],
"propagate": False,
},
},
}

View File

@@ -12,7 +12,7 @@ keys=gunicorn_format
level=WARNING
handlers=
# Gunicorn internal logger
# Gunicorn internal logger (overridden at runtime)
[logger_gunicorn]
level=INFO
handlers=console_gunicorn

View File

@@ -40,8 +40,10 @@ export ROMM_BASE_PATH=${ROMM_BASE_PATH:-/romm}
export ROMM_PORT=${ROMM_PORT:-8080}
# Disable nginx access logs when log level is WARNING, ERROR, or CRITICAL
case "${LOGLEVEL:-INFO}" in
WARNING | ERROR | CRITICAL | warning | error | critical)
loglevel="${LOGLEVEL:-INFO}"
loglevel="${loglevel^^}"
case "${loglevel}" in
WARNING | WARN | ERROR | CRITICAL)
export NGINX_ACCESS_LOG="access_log off;"
;;
*)

View File

@@ -93,6 +93,10 @@ start_bin_gunicorn() {
# cleanup potentially leftover socket
rm /tmp/gunicorn.sock -f
# Wire LOGLEVEL into Gunicorn's logging config so it respects the env var
local gunicorn_level="${LOGLEVEL^^}"
sed -i '/\[logger_gunicorn\]/,/^\[/ s/^level=.*/level='"${gunicorn_level}"'/' /etc/gunicorn/logging.conf
# commands to start our main application and store its PID to check for crashes
info_log "Starting backend"