Skip to content

Instantly share code, notes, and snippets.

@kayintveen
Last active June 12, 2018 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kayintveen/2c0ba9b1475928e925d260acff8fa988 to your computer and use it in GitHub Desktop.
Save kayintveen/2c0ba9b1475928e925d260acff8fa988 to your computer and use it in GitHub Desktop.
Magento2 log all sql queries
// in app/etc/di.xml
// change the following lines
<preference for="Magento\Framework\DB\LoggerInterface" type="Magento\Framework\DB\Logger\LoggerProxy"/>
// for the following:
<type name="Magento\Framework\DB\Logger\File">
<arguments>
<argument name="logAllQueries" xsi:type="boolean">true</argument>
<argument name="debugFile" xsi:type="string">log/sql.log</argument>
</arguments>
</type>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment