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

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

      1. <tfoot id='QVNeo'></tfoot>
        <i id='QVNeo'><tr id='QVNeo'><dt id='QVNeo'><q id='QVNeo'><span id='QVNeo'><b id='QVNeo'><form id='QVNeo'><ins id='QVNeo'></ins><ul id='QVNeo'></ul><sub id='QVNeo'></sub></form><legend id='QVNeo'></legend><bdo id='QVNeo'><pre id='QVNeo'><center id='QVNeo'></center></pre></bdo></b><th id='QVNeo'></th></span></q></dt></tr></i><div id='QVNeo'><tfoot id='QVNeo'></tfoot><dl id='QVNeo'><fieldset id='QVNeo'></fieldset></dl></div>
        • <bdo id='QVNeo'></bdo><ul id='QVNeo'></ul>
      2. Zend_Log in application.ini

        时间:2023-05-30
            <tbody id='ILfr5'></tbody>
          • <bdo id='ILfr5'></bdo><ul id='ILfr5'></ul>

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

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

                <tfoot id='ILfr5'></tfoot>
                • <legend id='ILfr5'><style id='ILfr5'><dir id='ILfr5'><q id='ILfr5'></q></dir></style></legend>
                  本文介绍了Zend_Log in application.ini的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  是否有任何示例如何从 application.ini 设置 Zend 日志的实例?我只找到了一个记录到文件的示例,但我想登录到 SQLITE 数据库表?

                  is there any example how to setup an instance of zend log from application.ini? I have only found an example for logging to an file, but i want to log into an SQLITE database table?

                  Zend 日志资源

                  推荐答案

                  好问题.我找不到从引导程序配置实例化 Zend_Log_Writer_Db 的方法.writer 类需要一个 Zend_Db_Adapter 对象.它不接受字符串.

                  Good question. I can't find a way to instantiate the Zend_Log_Writer_Db from a bootstrap config. The writer class requires a Zend_Db_Adapter object. It doesn't accept a string.

                  采埃孚项目需要进一步开发这个用例.他们甚至没有任何包含数据库编写器的 Zend_Application_Resource_Log 单元测试.

                  The ZF project needs to develop this use case further. They don't even have any unit tests for Zend_Application_Resource_Log that include a Db writer.

                  在那之前我最好的建议是,您的 Bootstrap 类需要在 _initLog() 方法中自定义 Log 资源.

                  The best I can suggest until then is that you Bootstrap class needs to customize the Log resource in an _initLog() method.

                  class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
                  {
                  
                    protected function _initDb()
                    {
                      if ($this->hasPluginResource("db")) {
                        $r = $this->getPluginResource("db");
                        $db = $r->getDbAdapter();
                        Zend_Registry::set("db", $db);
                      }
                    }
                  
                    protected function _initLog()
                    {
                      if ($this->hasPluginResource("log")) {
                        $r = $this->getPluginResource("log");
                        $log = $r->getLog();
                  
                        $db = Zend_Registry::get("db");
                        $writer = new Zend_Log_Writer($db, "log", ...columnMap...);
                        $log->addWriter($writer);
                  
                        Zend_Registry::set("log", $log);
                      }
                    }
                  
                  }
                  

                  这篇关于Zend_Log in application.ini的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Zend_Db:如何通过 SSH 隧道连接到 MySQL 数据库? 下一篇:在 PHP 中使用 jqgrid 上传文件

                  相关文章

                        <bdo id='3K5bg'></bdo><ul id='3K5bg'></ul>
                    1. <legend id='3K5bg'><style id='3K5bg'><dir id='3K5bg'><q id='3K5bg'></q></dir></style></legend>

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

                      <small id='3K5bg'></small><noframes id='3K5bg'>