Why Zend_Log_Writer_Firebug can't log messages from dispatchLoopShutdown plugin?

482 Views Asked by At

Why logs can be sent from dispatchLoopShutdown plugin as it occurs before Zend_Controller_Response_Abstract->sendResponse() and any headers haven't been sent yet ?

I init logger resource in my bootstrap

  protected function _initLogger()
  {
    $writer = new Zend_Log_Writer_Firebug();
    $logger = new Zend_Log($writer);

    Zend_Registry::set('logger', $logger);
    return $logger;
  }

and use it from anywhere

Zend_Registry::get('logger')->debug('test');

and it works up to dispatchLoopShutdown plugin execution point...

2

There are 2 best solutions below

0
On BEST ANSWER

AFAIK the Firebug writer has his own plugin in the dispatchLoopShutdown to inject the data in the response. You should add your plugin with a lower priority (see manual).

0
On

Zend_Log_Writer_Firebug itself registers his dispatchLoopShutdown plugin (dLSp for short) during it first run, so to get this logger working in dLSp you need Zend_Log_Writer_Firebug's dLSp (Zend_Wildfire_Channel_HttpHeaders) to be already registered before calling logger in dLSp. You can achieve this for examle by calling $logger->log('') in your bootstrap