• <legend id='4iIWA'><style id='4iIWA'><dir id='4iIWA'><q id='4iIWA'></q></dir></style></legend>

    <small id='4iIWA'></small><noframes id='4iIWA'>

      <tfoot id='4iIWA'></tfoot>
        • <bdo id='4iIWA'></bdo><ul id='4iIWA'></ul>

        <i id='4iIWA'><tr id='4iIWA'><dt id='4iIWA'><q id='4iIWA'><span id='4iIWA'><b id='4iIWA'><form id='4iIWA'><ins id='4iIWA'></ins><ul id='4iIWA'></ul><sub id='4iIWA'></sub></form><legend id='4iIWA'></legend><bdo id='4iIWA'><pre id='4iIWA'><center id='4iIWA'></center></pre></bdo></b><th id='4iIWA'></th></span></q></dt></tr></i><div id='4iIWA'><tfoot id='4iIWA'></tfoot><dl id='4iIWA'><fieldset id='4iIWA'></fieldset></dl></div>

        如何阻止 Symfony 记录 Doctrine 的 sql 查询?

        时间:2023-08-18
            <tbody id='FMDrq'></tbody>

          <legend id='FMDrq'><style id='FMDrq'><dir id='FMDrq'><q id='FMDrq'></q></dir></style></legend>

        1. <i id='FMDrq'><tr id='FMDrq'><dt id='FMDrq'><q id='FMDrq'><span id='FMDrq'><b id='FMDrq'><form id='FMDrq'><ins id='FMDrq'></ins><ul id='FMDrq'></ul><sub id='FMDrq'></sub></form><legend id='FMDrq'></legend><bdo id='FMDrq'><pre id='FMDrq'><center id='FMDrq'></center></pre></bdo></b><th id='FMDrq'></th></span></q></dt></tr></i><div id='FMDrq'><tfoot id='FMDrq'></tfoot><dl id='FMDrq'><fieldset id='FMDrq'></fieldset></dl></div>

              <bdo id='FMDrq'></bdo><ul id='FMDrq'></ul>

              <small id='FMDrq'></small><noframes id='FMDrq'>

              • <tfoot id='FMDrq'></tfoot>
                  本文介绍了如何阻止 Symfony 记录 Doctrine 的 sql 查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个奇怪的问题,当我检查我的 app/log/dev.log 时,我可以看到我的 dev.log 中几乎所有的查询都被登录了实时:

                  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:

                  [2015-01-27 06:57:22] doctrine.DEBUG: SELECT t0.username A ....
                  [2015-01-27 06:57:23] doctrine.DEBUG: SELECT t0.username A ...
                  [2015-01-27 06:57:23] doctrine.DEBUG: SELECT s0_.id ......
                  

                  我不知道为什么会这样,因为当我在 config.yml 中检查 monolog 时,我也在生产模式下运行站点,这就是我看到的:

                  I have no idea why this is happening, since I am running the site on production mode also when I check monolog in my config.yml, this is what I see:

                  monolog:
                      handlers:
                          pictures:
                              type: stream
                              path: %kernel.logs_dir%/pictures_%kernel.environment%.log
                              level: info
                          instagram:
                              type: stream
                              path: %kernel.logs_dir%/instagram_%kernel.environment%.log
                              level: info
                  

                  这是我的 config_dev.yml 的样子:

                  here's what my config_dev.yml looks like:

                  imports:
                      - { resource: config.yml }
                  
                  framework:
                      router:   { resource: "%kernel.root_dir%/config/routing_dev.yml" }
                      profiler: { only_exceptions: false }
                  
                  web_profiler:
                      toolbar: true
                      intercept_redirects: false
                  
                  monolog:
                      handlers:
                          main:
                              type:  stream
                              path:  %kernel.logs_dir%/%kernel.environment%.log
                              level: debug
                          firephp:
                              type:  firephp
                              level: info
                  
                  assetic:
                      use_controller: false
                  
                  hip_mandrill:
                      disable_delivery: true    
                  

                  知道这是怎么发生的吗?

                  any idea how this could be happening?

                  推荐答案

                  你应该在你的生产服务器上使用 prod env.在 prod 环境原则的日志记录在默认情况下是禁用的.

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

                  但是,如果您想完全禁用日志记录(在所有环境中),您需要像这样设置 config.yml:

                  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
                  

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

                  这篇关于如何阻止 Symfony 记录 Doctrine 的 sql 查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Symfony2 表单集合:如何从集合中删除实体? 下一篇:在 Doctrine 2.x ORM 中使用 REGEXP

                  相关文章

                  <i id='B3Rof'><tr id='B3Rof'><dt id='B3Rof'><q id='B3Rof'><span id='B3Rof'><b id='B3Rof'><form id='B3Rof'><ins id='B3Rof'></ins><ul id='B3Rof'></ul><sub id='B3Rof'></sub></form><legend id='B3Rof'></legend><bdo id='B3Rof'><pre id='B3Rof'><center id='B3Rof'></center></pre></bdo></b><th id='B3Rof'></th></span></q></dt></tr></i><div id='B3Rof'><tfoot id='B3Rof'></tfoot><dl id='B3Rof'><fieldset id='B3Rof'></fieldset></dl></div>

                  1. <small id='B3Rof'></small><noframes id='B3Rof'>

                        <bdo id='B3Rof'></bdo><ul id='B3Rof'></ul>

                      <legend id='B3Rof'><style id='B3Rof'><dir id='B3Rof'><q id='B3Rof'></q></dir></style></legend>

                    1. <tfoot id='B3Rof'></tfoot>