jyotip
30 September 2022 07:28
1
Hello All,
I want to sort the report dropdown of Generic Dashlet : Options
I want to print $ZZZZf5 varibale in log with the help of $GLOBALS[‘log’]->fatal(print($ZZZZf5)); file but I am unable to get any result in log file, kindly assist.
Thanks in advance
pgr
30 September 2022 08:25
2
Remove the print call, leave just the variable name
jyotip
30 September 2022 08:48
3
Hi @pgr thanks for reply
$GLOBALS['log']->fatal($ZZZZf5); i used this also but nothing is coming
pgr
30 September 2022 08:57
4
Sorry, my bad. You do need some way to echo out the variable, it’s just that print is not even a function call, it’s a statement in PHP.
Here are some examples:
$GLOBALS['log']->fatal("Using string interpolation with double-quotes: $oneValue, $anotherValue");
$GLOBALS['log']->fatal('With complex values such as arrays: ' . print_r($row, true));
Use the print_r function instead of print function & pass the TRUE argument in the print_r function.
Ex: $GLOBALS[‘log’]->fatal(print_r($ZZZZf5, TRUE));
Thanks @pgr
I tried both but I am not getting any result
$GLOBALS[‘log’]->fatal(“Using string interpolation with double-quotes: $ZZZZf5, $ZZZZf5”);
$GLOBALS['log']->fatal(print_r($ZZZZf5, TRUE));
$GLOBALS['log']->fatal('With complex values such as arrays: ' . print_r($ZZZZf5, true));
I tried like this
pgr
2 October 2022 17:54
7
What if you just write a fixed string, without any variables, do you see it in the log?
If you have a PHP syntax error, it will show in the other log, php_errors.log
You should always check both those logs.
What if you just write a fixed string, without any variables, do you see it in the log?
I checked in PHP error log too but there is nothing
pgr
5 October 2022 10:38
9
Then I guess it’s just your variable, probably empty or null.