From 8c4698fdffa70f1adafcfd0f50e981e23bf97371 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Fri, 8 Dec 2017 07:51:56 +0100 Subject: [PATCH] Add MySQL query logging if DEBUG is set --- 01-basic.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/01-basic.sh b/01-basic.sh index 1d4c7df..bccbf9b 100755 --- a/01-basic.sh +++ b/01-basic.sh @@ -143,6 +143,14 @@ systemctl restart postgresql # Install packages apt-get -y --no-install-recommends install mariadb-server +# Enable query logging. Only if the DEBUG environment variable is set +if [ ${DEBUG:-0} -eq 1 ]; then + sed -i 's/#general_log/general_log/g' /etc/mysql/mariadb.conf.d/50-server.cnf +fi + +# Restart +systemctl restart mysqld + ##### # Tomcat