mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 06:46:00 +00:00
fix: respect LOGLEVEL env var for all log output sources
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/0b5ef21c-89e1-4f08-b402-03f3276aab08 Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
cc2dffc6cc
commit
d6036cb5ef
@@ -93,6 +93,48 @@ start_bin_gunicorn() {
|
||||
# cleanup potentially leftover socket
|
||||
rm /tmp/gunicorn.sock -f
|
||||
|
||||
# Generate gunicorn logging config with the configured log level
|
||||
cat >/etc/gunicorn/logging.conf <<EOF
|
||||
[loggers]
|
||||
keys=root,gunicorn,error
|
||||
|
||||
[handlers]
|
||||
keys=console_gunicorn
|
||||
|
||||
[formatters]
|
||||
keys=gunicorn_format
|
||||
|
||||
# Root logger — KEEP but minimal
|
||||
[logger_root]
|
||||
level=WARNING
|
||||
handlers=
|
||||
|
||||
# Gunicorn internal logger
|
||||
[logger_gunicorn]
|
||||
level=${LOGLEVEL}
|
||||
handlers=console_gunicorn
|
||||
qualname=gunicorn
|
||||
propagate=0
|
||||
|
||||
# Gunicorn error logger (optional)
|
||||
[logger_error]
|
||||
level=${LOGLEVEL}
|
||||
handlers=console_gunicorn
|
||||
qualname=gunicorn.error
|
||||
propagate=0
|
||||
|
||||
# Handler for Gunicorn logs
|
||||
[handler_console_gunicorn]
|
||||
class=StreamHandler
|
||||
formatter=gunicorn_format
|
||||
args=(sys.stdout,)
|
||||
|
||||
# Formatter for Gunicorn logs
|
||||
[formatter_gunicorn_format]
|
||||
format=INFO: [RomM][gunicorn][%%(asctime)s] %%(message)s
|
||||
datefmt=%Y-%m-%d %H:%M:%S
|
||||
EOF
|
||||
|
||||
# commands to start our main application and store its PID to check for crashes
|
||||
info_log "Starting backend"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user