[DEV-258] Add log commands for PHP debugging

This commit is contained in:
Maxi Redigonda 2022-03-16 09:49:13 -03:00
parent e0738f1c88
commit bfc69f70f7
4 changed files with 23 additions and 0 deletions

View File

@ -25,6 +25,12 @@ test:
log:
@docker attach opensupports-srv || echo "${red}Please execute 'make run' first${reset}"
clear-debug:
@docker exec -it opensupports-srv bash -c "cd /var/www/html && ./run-clear-debug.sh"
debug:
@docker exec -it opensupports-srv bash -c "cd /var/www/html && ./run-debug.sh"
stop:
@docker stop opensupports-db && docker rm opensupports-db || true
@docker stop opensupports-myadmin && docker rm opensupports-myadmin || true

7
server/libs/Logger.php Normal file
View File

@ -0,0 +1,7 @@
<?php
class Logger {
public static function debug($data) {
error_log(print_r($data, true), 3, "/var/tmp/debug.log");
}
}

5
server/run-clear-debug.sh Executable file
View File

@ -0,0 +1,5 @@
cd /var/tmp
if [ -f debug.log ]
then
rm debug.log
fi

5
server/run-debug.sh Executable file
View File

@ -0,0 +1,5 @@
cd /var/tmp
if [ -f debug.log ]
then
cat debug.log
fi