PHP: Debug Backtrace with Example

This article shows how we can use the debug_backtrace() PHP function to generate a backtrace. This function returns an array of associative arrays. It includes the current function name, file name, class name, line number, etc. where the debug backtrace function was called. Syntax debug_backtrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT, int $limit = 0): array Parameters $options … Read more

Magento 2: Enable Database/MySQL Query Log

MySQL database query logging can be enabled/disabled from command line. This will help in debugging database queries. Enable database query logging The following CLI command enabled database/mysql query log: bin/magento dev:query-log:enable Flush cache bin/magento cache:flush After that, browse your Magento site. The database queries logs are saved in the file var/debug/db.log. Note: The database query … Read more