From cf5c468e88e60b7a7a4bfb5a753cbad8810d8409 Mon Sep 17 00:00:00 2001
From: David Beniamine <david.beniamine@tetras-libre.fr>
Date: Mon, 14 Apr 2025 13:59:41 +0200
Subject: [PATCH] Improve logs

---
 doli | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/doli b/doli
index 300c2c5..97a4682 100755
--- a/doli
+++ b/doli
@@ -70,6 +70,13 @@ else
     cmdrestart="apache2ctl restart"
 fi
 
+
+if [ ! -z "$(which cczf)" ]; then
+	reader="ccze -A"
+else
+	reader="tee"
+fi
+
 pass=$(get_conf_val main_db_pass)
 mysql="mariadb -u $user $db -p$pass"
 DIR="$(dirname $0)"
@@ -95,8 +102,9 @@ case $action in
 			$document_path/cron_run_jobs.php.log \
 			$document_path/dolibarr.log \
 			/var/log/apache2/access.log \
-			/var/log/apache2/error.log \
-			/var/log/apache2/erro..log
+			/var/log/apache2/dolibarr_access.log \
+			/var/log/apache2/dolibarr_error.log \
+			/var/log/apache2/dolibarr_erro..log  | $reader
 		set +x
 		;;
     "mysql")
-- 
GitLab