How to log all Magento 2 SQL queries?

In your app/etc/di.xml, replace the line:

with

 

Magento 2 – How to get value in “core_config_data” table

First you need to include the Magento\Store\Model\ScopeInterface class in your constructor:

Then in your class’ method you can call the following:

 

Load Customer By Id Magento 2

Add Log in Magento 2 in New file

Magento2 How to remove or rename ‘Add New’ button from Admin Grid

Rename ‘Add New’ button

– Go to YourNamespace -> YourModule -> Block -> Adminhtml -> ModuleFile.php
– Add the following code in the constructor of this file:-

Remove ‘Add New’ button

– Go to YourNamespace -> YourModule -> Block -> Adminhtml -> ModuleFile.php
– Add the following code in the constructor of this file

Enable MySQL query logging in Magento 2

Open file app/etc/di.xml

Search below text

Changed to

We can also pass the arguments as below