0

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?

enter image description here

  • 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
0

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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.