How to stop Symfony from logging Doctrine's sql queries?

前端 未结 2 406
刺人心
刺人心 2021-01-13 06:19

I have a weird issue, when I checked my app/log/dev.log I can see almost all of my queries in my dev.log being logged in real time:



        
2条回答
  •  醉话见心
    2021-01-13 07:14

    You should use prod env on your production server. In the prod env doctrine's logging is disabled by default.

    But if you want to disable logging at all (in all environments) you need to set up a config.yml like that:

    doctrine:
        dbal:
            connections:
                conn1:
                    driver: ...
                    ...
                    logging: false
                    profiling: false
    

    Reference: https://symfony.com/doc/current/bundles/DoctrineBundle/configuration.html

提交回复
热议问题