• <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 查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <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>