Search code examples
phpzend-frameworkfirephp

Zend_Log_Writer_Firebug() not working


I have Firefox 3.6.15, Firebug and FirePHP addons installed, console enabled. I am using Zend 1.11. The following code doesn't show anything in the firebug console.

<?php
    require_once('Zend/Log.php');
    require_once('Zend/Log/Writer/Firebug.php');

    $writer = new Zend_Log_Writer_Firebug();
    $logger = new Zend_Log($writer);

    $logger->info('info message');
    $logger->warn('warning message');
    $logger->err('error message');
?>

I tried with the FirePHP core library and this works -

<?php
     require_once('FirePHPCore/FirePHP.class.php');
     ob_start();

     $firephp = FirePHP::getInstance(true); 
     $var = array('i'=>10, 'j'=>20);

     $firephp->log($var, 'Iterators');
?>

Would like to get the Zend thing working. Any idea?


Solution

  • Try with place

    $request = new Zend_Controller_Request_Http();
    $response = new Zend_Controller_Response_Http();
    $channel = Zend_Wildfire_Channel_HttpHeaders::getInstance();
    $channel->setRequest($request);
    $channel->setResponse($response);
    //buffering
    ob_start();
    

    before logger message.

    also after

    // flushing
    $channel->flush();
    $response->sendHeaders();