has been very vexed to a problem, some bugs can only be reproduced in the production environment, but I can not put a similar online
echo $test;
such as the code to debug, do not know if you have good experience to share.
Reply content:
has been very vexed to a problem, some bugs can only be reproduced in the production environment, but I can not put on the line similar echo $test;
to the code to debug, do not know if you have good experience to share.
Using Socketlog
There is nothing wrong with hot commissioning of the production environment, but exposing the code logic and debugging data during hot commissioning is much more of a death. You must not cultivate this habit.
The correct approach is to use log tools such as Monolog to record the information you want to track. You can use methods such as extra querystring to constrain the behavior of logging.
Of course, you can also set up a/test class of test routes, and then use permissions control to prohibit visitors to enter ... Not elegant enough.
Trigger_error (Var_export ($var, true));
Then go to the PHP error log to check
You set a debug_cookie=true and then change your browser's COOKIE to debug it.
Then you put the debug output into the log file, you can view it. and will not affect the appearance of the external network.
Similar to the answer of the flash, but I'm using
error_log(var_export($data, true));
You can also modify the second parameter of the function to write the information you want to print to the specified file.
Best Answer: Php-console
Https://github.com/barbushin/php-console
My usual practice can be the following, of course, the conditions within the variable
if ( 'debug' == $_GET['status'] ) { echo $test;}
This is a bit difficult. It's a good idea upstairs, and it's useless.
Like the first floor said the use of socketlog,xdebug,xhprof are good.
Use Docker to build an environment that enables local development debugging to have an environment that is the same as the server and a test database created with a backup of the production environment database during debugging
Chromephp::log ();
I wrote a log record of the class, in the need to debug the place to add the log code, you can
Simple debug output on the line, you can output the information to the file bar.