• <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 查询?

        How to stop Symfony from logging Doctrine#39;s sql queries?(如何阻止 Symfony 记录 Doctrine 的 sql 查询?)
            <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 查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Is PHP or PHP based web framework stateful or stateless?(PHP 或基于 PHP 的 Web 框架是有状态的还是无状态的?)
                  How to parse django style template tags(如何解析 django 样式模板标签)
                  What is a good setup for editing PHP in Emacs?(在 Emacs 中编辑 PHP 的好设置是什么?)
                  How to check whether specified PID is currently running without invoking ps from PHP?(如何在不从 PHP 调用 ps 的情况下检查指定的 PID 当前是否正在运行?)
                  What#39;s the difference between escapeshellarg and escapeshellcmd?(escapeshellarg 和escapeshellcmd 有什么区别?)
                  php in background exec() function(php 后台 exec() 函数)
                  <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>

                        <tbody id='B3Rof'></tbody>

                      <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>

                        • <tfoot id='B3Rof'></tfoot>