mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-30 23:40:08 +00:00
feat: add AIO_LOG_LEVEL env to configure log level across all main containers
Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/cd05ca56-d0e8-4260-988b-a7cc0747beff Co-authored-by: szaimen <42591237+szaimen@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
c104b179b7
commit
039bd42592
@@ -2,6 +2,7 @@
|
||||
|
||||
global
|
||||
maxconn 10
|
||||
# HAPROXY_LOG_PLACEHOLDER
|
||||
|
||||
defaults
|
||||
timeout connect 30s
|
||||
|
||||
@@ -8,7 +8,7 @@ done
|
||||
|
||||
set -x
|
||||
IPv4_ADDRESS_NC="$(dig nextcloud-aio-nextcloud IN A +short +search | grep '^[0-9.]\+$' | sort | head -n1)"
|
||||
HAPROXYFILE="$(sed "s|NC_IPV4_PLACEHOLDER|$IPv4_ADDRESS_NC|" /haproxy.cfg)"
|
||||
HAPROXYFILE="$(sed "s|NC_IPV4_PLACEHOLDER|$IPv4_ADDRESS_NC|" /haproxy.cfg)"
|
||||
echo "$HAPROXYFILE" > /tmp/haproxy.cfg
|
||||
|
||||
IPv6_ADDRESS_NC="$(dig nextcloud-aio-nextcloud AAAA +short +search | grep '^[0-9a-f:]\+$' | sort | head -n1)"
|
||||
@@ -18,6 +18,17 @@ else
|
||||
HAPROXYFILE="$(sed "s# || { src NC_IPV6_PLACEHOLDER }##g" /tmp/haproxy.cfg)"
|
||||
fi
|
||||
echo "$HAPROXYFILE" > /tmp/haproxy.cfg
|
||||
|
||||
# Apply AIO_LOG_LEVEL as HAProxy global log directive
|
||||
case "${AIO_LOG_LEVEL:-warning}" in
|
||||
debug) HAPROXY_LOG_LEVEL="debug" ;;
|
||||
info) HAPROXY_LOG_LEVEL="info" ;;
|
||||
warning) HAPROXY_LOG_LEVEL="notice" ;;
|
||||
error) HAPROXY_LOG_LEVEL="err" ;;
|
||||
*) HAPROXY_LOG_LEVEL="notice" ;;
|
||||
esac
|
||||
HAPROXYFILE="$(sed "s|# HAPROXY_LOG_PLACEHOLDER|log stdout format raw local0 $HAPROXY_LOG_LEVEL|" /tmp/haproxy.cfg)"
|
||||
echo "$HAPROXYFILE" > /tmp/haproxy.cfg
|
||||
set +x
|
||||
|
||||
haproxy -f /tmp/haproxy.cfg -db
|
||||
|
||||
Reference in New Issue
Block a user