When a user makes a search on a site(where search product), I would like to see SQL request this search. How can I see him?
-
Donot understand your question. – Amit Bera♦ Jun 7 '19 at 15:10
-
Didn't get the question. Brief the question – zed Blackbeard Jun 7 '19 at 15:18
-
when a user makes a search on a site(where search product), I would like to see SQL request this search. How can I see him? – Denis Maksiura Jun 10 '19 at 9:41
Assuming this is just to do some quick debugging you can log all SQL by editing vendor/magento/framework/DB/Adapter/Pdo/Mysql.php and in function _query() after where you see
$result = parent::query($sql, $bind);
Add the line
file_put_contents("my.log", $sql, FILE_APPEND) ;
Run the search and then look in the website root for your log file (it will be pretty large)