How to stop the DB log i had used the CLI to stop but it is not stopping it increasing to huge file. I used the below command but it is not stopping. It is in the path var/debug/db.log

bin/magento dev:query-log:disable

bin/magento cache:flush

1 Answer 1


I am not sure but try this code may be help you,

Go to this path app/etc/di.xml and add the code :

<preference for="Magento\Framework\DB\LoggerInterface" type="Magento\Framework\DB\Logger\File"/>
<type name="Magento\Framework\DB\Logger\File">
        <argument name="logAllQueries" xsi:type="boolean">false</argument>

and run the php bin/magento c:f

And more refer link :- https://somecrazy.com/magento-2-log-database-queries/

  • Hello it's answer is helpful or not ?? Apr 11, 2020 at 5:18
  • Not working @mohit May 11, 2022 at 10:42
  • Did you found any answer? I am facing similar issue. Tried with command, not working. file size increasing every hr alot Aug 9 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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